This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import IOKit | |
import IOKit.hid | |
import Quartz | |
let ioman = IOHIDManagerCreate(kCFAllocatorDefault, | |
IOOptionBits(kIOHIDOptionsTypeNone)) | |
let runloop : CFRunLoop = CFRunLoopGetCurrent() | |
let devices = [ | |
kIOHIDVendorIDKey: 0x0b33, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <IOKit/hid/IOHIDLib.h> | |
#include <IOKit/hidsystem/event_status_driver.h> | |
static int hid_mousex, hid_mousey; | |
static void hidCallback(void* context, IOReturn result, void* sender, IOHIDValueRef valueRef) | |
{ | |
IOHIDElementRef element = IOHIDValueGetElement(valueRef); | |
if (mouse_capture > 0 && IOHIDElementGetUsagePage(element) == kHIDPage_GenericDesktop) { | |
int value = (int)IOHIDValueGetIntegerValue(valueRef); |