VirtualBox

Changeset 48647 in vbox


Ignore:
Timestamp:
Sep 24, 2013 8:30:29 AM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
89245
Message:

Mac OS X host: keyboard LEDs sync: GUI part; code is still disabled.

Location:
trunk/src/VBox
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/DarwinKeyboard.cpp

    r48599 r48647  
    4444#endif
    4545#include <IOKit/hid/IOHIDLib.h>
     46#include <IOKit/hidsystem/IOHIDLib.h>
    4647#include <ApplicationServices/ApplicationServices.h>
    4748#include <Carbon/Carbon.h>
     
    14551456}
    14561457
     1458/** Call VBoxKeyboardService to sync keyboard controls and LEDs. */
     1459static void darwinVBoxKeyboardSync(void)
     1460{
     1461    CFDictionaryRef matchingDictionaryRef = IOServiceMatching("org_virtualbox_VBoxKeyboard");
     1462    if (matchingDictionaryRef)
     1463    {
     1464        io_service_t service;
     1465        service = IOServiceGetMatchingService(kIOMasterPortDefault, matchingDictionaryRef);
     1466        if (service)
     1467        {
     1468            kern_return_t rc;
     1469            io_connect_t  connection;
     1470            rc = IOServiceOpen(service, mach_task_self(), 0, &connection);
     1471            if (rc == 0)
     1472            {
     1473                Log2(("VBoxKeyboard IOService opened!\n"));
     1474
     1475                rc = IOConnectCallScalarMethod(connection, 0, NULL, 0, NULL, 0);
     1476                Log2(("VBoxKeyboard IOService IOCTL: 0x%X!\n", rc));
     1477
     1478                rc = IOServiceClose(connection);
     1479                if (rc == 0)
     1480                {
     1481                    Log2(("VBoxKeyboard IOService closed!\n"));
     1482                }
     1483                else
     1484                {
     1485                    Log2(("Unable to close VBoxKeyboard IOService: 0x%X\n", rc));
     1486                }
     1487            }
     1488            else
     1489            {
     1490                Log2(("Unable to open VBoxKeyboard IOService: 0x%X\n", rc));
     1491            }
     1492
     1493            IOObjectRelease(service);
     1494        }
     1495        else
     1496        {
     1497            Log2(("Unable to find VBoxKeyboard IOService\n"));
     1498        }
     1499
     1500    }
     1501    else
     1502    {
     1503        Log2(("Unable to construct VBoxKeyboard IOService matching dictionary\n"));
     1504    }
     1505}
     1506
    14571507/**
    14581508 * Apply LEDs state stored in *pState and release resources aquired by *pState.
     
    14881538                    rc2 = kIOReturnError;
    14891539                }
     1540
    14901541            }
     1542
     1543            darwinVBoxKeyboardSync();
    14911544        }
    14921545
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp

    r48534 r48647  
    10171017        ::CGSetLocalEventsSuppressionInterval(0.0);
    10181018        ::darwinSetMouseCoalescingEnabled(false);
     1019
     1020        /* Bring the caps lock state up to date, otherwise e.g. a later Shift
     1021         * key press will accidentally inject a CapsLock key press and release,
     1022         * see UIKeyboardHandler::darwinKeyboardEvent for the code handling
     1023         * modifier key state changes */
     1024        m_darwinKeyModifiers ^= (m_darwinKeyModifiers ^ ::GetCurrentEventKeyModifiers()) & alphaLock;
    10191025
    10201026        /* Register the event callback/hook and grab the keyboard. */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r48577 r48647  
    10341034                     * set current lock states to guest values we have,
    10351035                     * As we have no ipc between threads of different VMs
    1036                      * we are using 100ms timer as lazy sync timout: */
    1037                     QTimer::singleShot(100, this, SLOT(sltSwitchKeyboardLedsToGuestLeds()));
     1036                     * we are using 300ms timer as lazy sync timout: */
     1037                    QTimer::singleShot(300, this, SLOT(sltSwitchKeyboardLedsToGuestLeds()));
    10381038                    break;
    10391039                }
  • trunk/src/VBox/HostDrivers/Support/Makefile.kmk

    r48282 r48647  
    304304
    305305 VBoxDrv_SOURCES.darwin   = \
    306         darwin/SUPDrv-darwin.cpp
     306        darwin/SUPDrv-darwin.cpp \
     307        darwin/SUPKeyboardService-darwin.cpp
    307308 VBoxDrv_SOURCES.linux    = \
    308309        linux/SUPDrv-linux.c
  • trunk/src/VBox/HostDrivers/Support/darwin/Info.plist

    r45365 r48647  
    2525            <key>IOUserClientClass</key>        <string>org_virtualbox_SupDrvClient</string>
    2626        </dict>
     27        <key>VBoxDrvKeyboard</key>
     28        <dict>
     29            <key>CFBundleIdentifier</key>       <string>org.virtualbox.kext.VBoxDrv</string>
     30            <key>IOClass</key>                  <string>org_virtualbox_VBoxKeyboard</string>
     31            <key>IOMatchCategory</key>          <string>org_virtualbox_VBoxKeyboard</string>
     32            <key>IOProviderClass</key>          <string>IOResources</string>
     33            <key>IOResourceMatch</key>          <string>IOKit</string>
     34            <key>IOUserClientClass</key>        <string>org_virtualbox_VBoxKeyboardClient</string>
     35        </dict>
    2736    </dict>
    2837    <key>OSBundleLibraries</key>
Note: See TracChangeset for help on using the changeset viewer.

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