From: Jay Freeman (saurik) Date: Mon, 27 Jan 2014 03:00:00 +0000 (-0800) Subject: Carve out a new function for the IOHID input code. X-Git-Tag: v0.9.3400~12 X-Git-Url: https://git.saurik.com/veency.git/commitdiff_plain/f22678fa39008974fda058dfd6b3242daa6a971e Carve out a new function for the IOHID input code. --- diff --git a/CoreFoundation/CFUserNotification.h b/CoreFoundation/CFUserNotification.h deleted file mode 120000 index 4007e0d..0000000 --- a/CoreFoundation/CFUserNotification.h +++ /dev/null @@ -1 +0,0 @@ -/System/Library/Frameworks/CoreFoundation.framework/Versions/A/Headers/CFUserNotification.h \ No newline at end of file diff --git a/Tweak.mm b/Tweak.mm index 0d49df7..807022f 100644 --- a/Tweak.mm +++ b/Tweak.mm @@ -428,6 +428,9 @@ struct VeencyEvent { } data; }; +static void VNCPointerOld(int buttons, int x, int y, CGPoint location, int diff, bool twas, bool tis); +static void VNCPointerNew(int buttons, int x, int y, CGPoint location, int diff, bool twas, bool tis); + static void VNCPointer(int buttons, int x, int y, rfbClientPtr client) { if (ratio_ == 0) return; @@ -461,6 +464,13 @@ static void VNCPointer(int buttons, int x, int y, rfbClientPtr client) { return; } + if (kCFCoreFoundationVersionNumber >= 800) + return VNCPointerNew(buttons, x, y, location, diff, twas, tis); + else + return VNCPointerOld(buttons, x, y, location, diff, twas, tis); +} + +static void VNCPointerOld(int buttons, int x, int y, CGPoint location, int diff, bool twas, bool tis) { mach_port_t purple(0); if ((diff & 0x10) != 0) { @@ -561,6 +571,9 @@ static void VNCPointer(int buttons, int x, int y, rfbClientPtr client) { mach_port_deallocate(mach_task_self(), purple); } +static void VNCPointerNew(int buttons, int x, int y, CGPoint location, int diff, bool twas, bool tis) { +} + GSEventRef (*$GSEventCreateKeyEvent)(int, CGPoint, CFStringRef, CFStringRef, id, UniChar, short, short); GSEventRef (*$GSCreateSyntheticKeyEvent)(UniChar, BOOL, BOOL); diff --git a/include/CoreFoundation/CFUserNotification.h b/include/CoreFoundation/CFUserNotification.h new file mode 120000 index 0000000..4007e0d --- /dev/null +++ b/include/CoreFoundation/CFUserNotification.h @@ -0,0 +1 @@ +/System/Library/Frameworks/CoreFoundation.framework/Versions/A/Headers/CFUserNotification.h \ No newline at end of file