VirtualBox

Ignore:
Timestamp:
Dec 17, 2013 8:20:45 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
91384
Message:

Mac OS X host: HID LEDs sync: take care about bluetooth keyboard: wake it up before setting LED in order to decrease LED-set-operation delay up to ~1-0.5 seconds.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp

    r49955 r49965  
    6868#include <IOKit/IODeviceTreeSupport.h>
    6969#include <IOKit/usb/IOUSBHIDDriver.h>
     70#include <IOKit/bluetooth/IOBluetoothHIDDriver.h>
     71#include <IOKit/bluetooth/IOBluetoothHIDDriverTypes.h>
    7072
    7173#ifdef VBOX_WITH_HOST_VMX
     
    11471149#endif /* SUPDRV_WITH_MSR_PROBER */
    11481150
     1151/**
     1152 * Resume Bluetooth keyboard.
     1153 * If there is no Bluetooth keyboard device connected to the system we just ignore this.
     1154 */
     1155static void supdrvDarwinResumeBluetoothKbd(void)
     1156{
     1157    OSDictionary *pDictionary = IOService::serviceMatching("AppleBluetoothHIDKeyboard");
     1158    if (pDictionary)
     1159    {
     1160        OSIterator     *pIter;
     1161        IOBluetoothHIDDriver *pDriver;
     1162
     1163        pIter = IOService::getMatchingServices(pDictionary);
     1164        if (pIter)
     1165        {
     1166            while ((pDriver = (IOBluetoothHIDDriver *)pIter->getNextObject()))
     1167                if (pDriver->isKeyboard())
     1168                    (void)pDriver->hidControl(IOBTHID_CONTROL_EXIT_SUSPEND);
     1169
     1170            pIter->release();
     1171        }
     1172        pDictionary->release();
     1173    }
     1174}
    11491175
    11501176/**
    11511177 * Resume built-in keyboard on MacBook Air and Pro hosts.
    1152  * If there is no built-in keyboard device, return success anyway.
    1153  */
    1154 int VBOXCALL    supdrvDarwinResumeBuiltinKbd(void)
     1178 * If there is no built-in keyboard device attached to the system we just ignore this.
     1179 */
     1180static void supdrvDarwinResumeBuiltinKbd(void)
    11551181{
    11561182    /*
     
    11741200        pDictionary->release();
    11751201    }
     1202}
     1203
     1204
     1205/**
     1206 * Resume suspended keyboard devices (if any).
     1207 */
     1208int VBOXCALL    supdrvDarwinResumeSuspendedKbds(void)
     1209{
     1210    supdrvDarwinResumeBuiltinKbd();
     1211    supdrvDarwinResumeBluetoothKbd();
    11761212
    11771213    return 0;
    11781214}
    1179 
    11801215
    11811216
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