VirtualBox

Changeset 1320 in vbox


Ignore:
Timestamp:
Mar 8, 2007 6:59:53 AM (18 years ago)
Author:
vboxsync
Message:

Hack to ignore Command-H and Command-Q when the keyboard is captured. (todo: proper fix / translate the events into key down/up.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp

    r1315 r1320  
    118118    {
    119119        if (view->darwinKeyboardEvent (inEvent))
     120            return 0;
     121    }
     122    /*
     123     * Command-H and Command-Q aren't properly disabled yet, and it's still
     124     * possible to use the left command key to invoke them when the keyboard
     125     * is captured. We discard the events these if the keyboard is captured
     126     * as a half measure to prevent unexpected behaviour. However, we don't
     127     * get any key down/up events, so these combinations are dead to the guest...
     128     */
     129    else if (EventClass == kEventClassCommand)
     130    {
     131        if (view->kbd_captured)
    120132            return 0;
    121133    }
     
    659671    else if (on)
    660672        darwinGrabKeyboardEvents (false);
    661 #endif 
     673#endif
    662674
    663675    return ok;
     
    14321444        ::CGSetLocalEventsSuppressionInterval (0.0);    //??
    14331445
    1434         EventTypeSpec eventTypes[4];
     1446        EventTypeSpec eventTypes[6];
    14351447        eventTypes[0].eventClass = kEventClassKeyboard;
    14361448        eventTypes[0].eventKind  = kEventRawKeyDown;
     
    14411453        eventTypes[3].eventClass = kEventClassKeyboard;
    14421454        eventTypes[3].eventKind  = kEventRawKeyModifiersChanged;
     1455        /* For ignorning Command-H and Command-Q which aren't affected by the
     1456         * global hotkey stuff: */
     1457        eventTypes[4].eventClass = kEventClassCommand;
     1458        eventTypes[4].eventKind  = kEventCommandProcess;
     1459        eventTypes[5].eventClass = kEventClassCommand;
     1460        eventTypes[5].eventKind  = kEventCommandUpdateStatus;
    14431461
    14441462        EventHandlerUPP eventHandler = ::NewEventHandlerUPP (VBoxConsoleView::darwinEventHandlerProc);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette