rendered paste bodyvoid IRKeyboardEmu::readInput(void)
{
OSDictionary *dataDictionary;
OSBoolean *value;
OSNumber *number;
dataDictionary = OSDynamicCast(OSDictionary, getProperty(kKeyInput));
if(dataDictionary == NULL) return;
number = OSDynamicCast(OSNumber,dataDictionary->getObject("keyCode"));
if(number != NULL) inputCode = number->unsigned32BitValue();
IOLog("keyCode = %d", inputCode);
}
// Called by the userspace IORegistryEntrySetCFProperties function
IOReturn IRKeyboardEmu::setProperties(OSObject *properties)
{
OSDictionary *dictionary = OSDynamicCast(OSDictionary,properties);
if(dictionary != NULL)
{
setProperty(kKeyInput, dictionary);
readInput();
issueFakeReport(inputCode);
return kIOReturnSuccess;
} else return kIOReturnBadArgument;
}