GSEvent.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472
  1. /*
  2. GSEvent.h ... Graphics Service Events.
  3. Copyright (c) 2009, KennyTM~
  4. All rights reserved.
  5. Redistribution and use in source and binary forms, with or without modification,
  6. are permitted provided that the following conditions are met:
  7. * Redistributions of source code must retain the above copyright notice, this
  8. list of conditions and the following disclaimer.
  9. * Redistributions in binary form must reproduce the above copyright notice,
  10. this list of conditions and the following disclaimer in the documentation
  11. and/or other materials provided with the distribution.
  12. * Neither the name of the KennyTM~ nor the names of its contributors may be
  13. used to endorse or promote products derived from this software without
  14. specific prior written permission.
  15. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  16. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  17. WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  18. DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
  19. ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  20. (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  21. LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  22. ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  23. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  24. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  25. */
  26. #ifndef GSEVENT_H
  27. #define GSEVENT_H
  28. #include "GSWindow.h"
  29. #include <mach/message.h>
  30. #include <CoreFoundation/CoreFoundation.h>
  31. #include <CoreGraphics/CoreGraphics.h>
  32. #include <Availability.h>
  33. #if __cplusplus
  34. extern "C" {
  35. #endif
  36. typedef struct __GSEvent* GSEventRef;
  37. typedef struct GSPathInfo {
  38. unsigned char pathIndex; // 0x0 = 0x5C
  39. unsigned char pathIdentity; // 0x1 = 0x5D
  40. unsigned char pathProximity; // 0x2 = 0x5E
  41. CGFloat pathPressure; // 0x4 = 0x60
  42. CGFloat pathMajorRadius; // 0x8 = 0x64
  43. CGPoint pathLocation; // 0xC = 0x68
  44. GSWindowRef pathWindow; // 0x14 = 0x70
  45. } GSPathInfo; // sizeof = 0x18.
  46. typedef enum __GSHandInfoType {
  47. kGSHandInfoTypeTouchDown = 0,
  48. kGSHandInfoTypeTouchDragged = 1,
  49. kGSHandInfoTypeTouchMoved = 4,
  50. kGSHandInfoTypeTouchUp = 5,
  51. kGSHandInfoTypeCancel = 8
  52. } GSHandInfoType;
  53. // A.k.a. XXStruct_$jUSvD
  54. typedef struct GSHandInfo {
  55. GSHandInfoType type; // 0x0 == 0x3C
  56. short deltaX, deltaY; // 2, 4 = 0x40, 0x42
  57. float _0x44;
  58. float _0x48;
  59. float width; // 0x10 == 0x4C
  60. float _0x50;
  61. float height; // 0x18 == 0x54
  62. float _0x58;
  63. unsigned char _0x5C;
  64. unsigned char pathInfosCount; // 0x22 == 0x5D
  65. GSPathInfo pathInfos[0]; // 0x60
  66. } GSHandInfo; // sizeof = 0x24.
  67. typedef struct __GSScrollWheelInfo {
  68. int deltaY;
  69. int deltaX;
  70. } GSScrollWheelInfo;
  71. typedef struct __GSAccelerometerInfo {
  72. CGFloat axisX, axisY, axisZ;
  73. } GSAccelerometerInfo;
  74. typedef struct __GSDeviceOrientationInfo {
  75. int orientation;
  76. } GSDeviceOrientationInfo;
  77. typedef struct __GSKeyInfo {
  78. UniChar keyCode, characterIgnoringModifier, charCode; // 0x3C, 0x3E, 0x40
  79. unsigned short characterSet; // 0x42
  80. Boolean isKeyRepeating; // 0x44
  81. } GSKeyInfo;
  82. typedef struct __GSHardwareKeyInfo {
  83. UniChar keyCode; // 3c
  84. UniChar characterIgnoringModifier; // 3e
  85. UniChar charCode; // 40
  86. unsigned short characterSet; // 42
  87. uint16_t characters_length; // 44
  88. UniChar characters[32]; // 46 .. 84
  89. uint16_t unmodified_characters_length; // 86
  90. UniChar unmodified_characters[32]; // 88 .. C6
  91. int unknown0 : 1;
  92. int isKeyVariant : 1;
  93. int unknown2 : 14;
  94. int unknown10 : 16;
  95. } GSHardwareKeyInfo;
  96. typedef struct __GSAccessoryKeyStateInfo {
  97. unsigned short a;
  98. int b;
  99. } GSAccessoryKeyStateInfo;
  100. typedef struct __GSAppPreferencesChangedInfo {
  101. size_t length;
  102. char appName[0];
  103. } GSAppPreferencesChangedInfo;
  104. typedef struct __GSResetIdleDurationInfo {
  105. int a, b;
  106. } GSResetIdleDurationInfo;
  107. typedef struct __GSEventProcessScriptInfo {
  108. int type;
  109. size_t length;
  110. char data[0];
  111. } GSEventProcessScriptInfo;
  112. typedef enum __GSEventType {
  113. kGSEventLeftMouseDown = 1,
  114. kGSEventLeftMouseUp = 2,
  115. kGSEventMouseMoved = 5,
  116. kGSEventLeftMouseDragged = 6,
  117. kGSEventKeyDown = 10,
  118. kGSEventKeyUp = 11,
  119. kGSEventModifiersChanged = 12,
  120. kGSEventSimulatorKeyDown = 13,
  121. kGSEventHardwareKeyDown = 14, // Maybe?
  122. kGSEventScrollWheel = 22,
  123. kGSEventAccelerate = 23,
  124. kGSEventProximityStateChanged = 24,
  125. kGSEventDeviceOrientationChanged = 50,
  126. kGSAppPreferencesChanged = 60,
  127. kGSEventUserDefaultsDidChange = 60, // backward compatibility.
  128. kGSEventResetIdleTimer = 100,
  129. kGSEventResetIdleDuration = 101,
  130. kGSEventProcessScript = 200,
  131. kGSEventDumpUIHierarchy = 500,
  132. kGSEventDumpScreenContents = 501,
  133. kGSEventMenuButtonDown = 1000,
  134. kGSEventMenuButtonUp = 1001,
  135. kGSEventVolumeChanged = 1006,
  136. kGSEventVolumeUpButtonDown = 1006,
  137. kGSEventVolumeUpButtonUp = 1007,
  138. kGSEventVolumeDownButtonDown = 1008,
  139. kGSEventVolumeDownButtonUp = 1009,
  140. kGSEventLockButtonDown = 1010,
  141. kGSEventLockButtonUp = 1011,
  142. kGSEventRingerOff = 1012,
  143. kGSEventRingerOn = 1013,
  144. kGSEventRingerChanged = 1013, // backward compatibility.
  145. kGSEventLockDevice = 1014,
  146. kGSEventStatusBarMouseDown = 1015,
  147. kGSEventStatusBarMouseDragged = 1016,
  148. kGSEventStatusBarMouseUp = 1017,
  149. kGSEventHeadsetButtonDown = 1018,
  150. kGSEventHeadsetButtonUp = 1019,
  151. kGSEventMotionBegin = 1020,
  152. kGSEventHeadsetAvailabilityChanged = 1021,
  153. kGSEventMediaKeyDown = 1022, // ≥3.2
  154. kGSEventMediaKeyUp = 1023, // ≥3.2
  155. kGSEventVibrate = 1100,
  156. kGSEventSetBacklightFactor = 1102,
  157. kGSEventSetBacklightLevel = 1103,
  158. kGSEventApplicationLaunch = 2000,
  159. kGSEventAnotherApplicationFinishedLaunching = 2001,
  160. kGSEventSetAppThreadPriority = 2002,
  161. kGSEventApplicationResume = 2003,
  162. kGSEventApplicationDidEndResumeAnimation = 2004,
  163. kGSEventApplicationBeginSuspendAnimation = 2005,
  164. kGSEventApplicationHandleTestURL = 2006,
  165. kGSEventApplicationSuspendEventsOnly = 2007,
  166. kGSEventApplicationSuspend = 2008,
  167. kGSEventApplicationExit = 2009,
  168. kGSEventQuitTopApplication = 2010,
  169. kGSEventApplicationUpdateSuspendedSettings = 2011,
  170. kGSEventHand = 3001,
  171. kGSEventAccessoryAvailabilityChanged = 4000,
  172. kGSEventAccessoryKeyStateChanged = 4001,
  173. kGSEventAccessory = 4002,
  174. kGSEventOutOfLineDataRequest = 5000,
  175. kGSEventOutOfLineDataResponse = 5001,
  176. kGSEventUrgentMemoryWarning = 6000,
  177. kGSEventShouldRouteToFrontMost = 1<<17
  178. } GSEventType;
  179. typedef enum __GSEventSubType {
  180. kGSEventSubTypeUnknown,
  181. } GSEventSubType;
  182. typedef enum GSEventFlags {
  183. kGSEventFlagMaskShift = 1 << 17,
  184. kGSEventFlagMaskControl = 1 << 18,
  185. kGSEventFlagMaskAlternate = 1 << 19,
  186. kGSEventFlagMaskCommand = 1 << 20
  187. } GSEventFlags;
  188. typedef struct GSEventRecord {
  189. GSEventType type; // 0x8
  190. GSEventSubType subtype; // 0xC
  191. CGPoint location; // 0x10
  192. CGPoint windowLocation; // 0x18
  193. int windowContextId; // 0x20
  194. uint64_t timestamp; // 0x24, from mach_absolute_time
  195. GSWindowRef window; // 0x2C
  196. GSEventFlags flags; // 0x30
  197. unsigned senderPID; // 0x34
  198. CFIndex infoSize; // 0x38
  199. } GSEventRecord;
  200. #pragma mark -
  201. #pragma mark General info
  202. CFTypeID GSEventGetTypeID();
  203. GSEventRef GSEventCopy(GSEventRef event);
  204. GSEventRef GSEventCreateWithEventRecord(const GSEventRecord* record);
  205. #if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_3_0 && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_3_2
  206. GSEventRef GSEventCreateWithTypeAndLocation(GSEventType type, CGPoint location);
  207. #endif
  208. GSEventRef GSEventCreateWithPlist(CFDictionaryRef dictionary) __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_2_2);
  209. const GSEventRecord* GSEventRecordGetRecordDataWithPlist(CFDictionaryRef plist) __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_2_2);
  210. void GSEventRecordGetRecordWithPlist(GSEventRef event_to_fill, CFDictionaryRef plist) __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_2_2);
  211. CFDictionaryRef GSEventCreatePlistRepresentation(GSEventRef event) __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_2_2);
  212. Boolean GSEventShouldRouteToFrontMost(GSEventRef event);
  213. void GSEventRemoveShouldRouteToFrontMost(GSEventRef event);
  214. GSEventType GSEventGetType(GSEventRef event);
  215. GSEventSubType GSEventGetSubType(GSEventRef event);
  216. #if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_3_0 && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_3_2
  217. int GSEventGetWindowContextId(GSEventRef event);
  218. #endif
  219. CGPoint GSEventGetLocationInWindow(GSEventRef event);
  220. CGPoint GSEventGetOuterMostPathPosition(GSEventRef event);
  221. CGPoint GSEventGetInnerMostPathPosition(GSEventRef event);
  222. CFAbsoluteTime GSEventGetTimestamp(GSEventRef event);
  223. GSWindowRef GSEventGetWindow(GSEventRef event);
  224. unsigned GSEventGetSenderPID(GSEventRef event) __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
  225. const GSEventRecord* _GSEventGetGSEventRecord(GSEventRef event);
  226. void GSEventSetLocationInWindow(GSEventRef event, CGPoint location);
  227. void GSEventSetType(GSEventRef event, GSEventType type);
  228. // GSHiccupsEnabled
  229. #pragma mark -
  230. #pragma mark Event queue processing
  231. Boolean GSEventQueueContainsMouseEvent();
  232. mach_port_t GSGetPurpleApplicationPort() __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
  233. Boolean GSGetTimeEventHandling();
  234. void GSSetTimeEventHandling(Boolean enable);
  235. void GSSaveEventHandlingTimes();
  236. CFAbsoluteTime _GSEventConvertFromMachTime(uint64_t machTime);
  237. uint64_t GSCurrentEventTimestamp();
  238. mach_port_name_t GSRegisterPurpleNamedPort(const char* service_name);
  239. mach_port_name_t GSCopyPurpleNamedPort(const char* service_name);
  240. mach_port_name_t GSGetPurpleSystemEventPort() __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
  241. void GSEventPopRunLoopMode(CFStringRef mode); ///< Stop the event run loop, and remove "mode" from the run loop mode stack if it is at the top.
  242. void GSEventPushRunLoopMode(CFStringRef mode); ///< Stop the event run loop and push "mode" to the top of run loop mode stack.
  243. void GSEventStopModal();
  244. void GSEventRunModal(Boolean disallow_restart);
  245. void GSEventRun();
  246. void GSEventInitialize(Boolean registerPurple);
  247. #pragma mark -
  248. #pragma mark Sending events
  249. void GSSendEvent(const GSEventRecord* record, mach_port_t port);
  250. void GSSendSimpleEvent(GSEventType type, mach_port_t port) __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0); ///< This calls GSSendEvent with an empty record.
  251. void GSSendSystemEvent(const GSEventRecord* record); ///< Send event to the PurpleSystemEventPort.
  252. #pragma mark -
  253. #pragma mark Callback functions
  254. /// Only 1 function can be registered.
  255. /// Register a callback function that will be called when PurpleEventCallback() is called.
  256. void GSEventRegisterEventCallBack(void(*callback)(GSEventRef event));
  257. #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_3_2
  258. void GSEventRegisterFindWindowCallBack(int(*callback)(CGPoint position));
  259. void GSEventRegisterTransformToWindowCoordsCallBack(void*) __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
  260. #endif
  261. #pragma mark -
  262. #pragma mark Touch events
  263. GSHandInfo GSEventGetHandInfo(GSEventRef event);
  264. GSPathInfo GSEventGetPathInfoAtIndex(GSEventRef event, CFIndex index);
  265. void GSEventSetPathInfoAtIndex(GSEventRef event, GSPathInfo pathInfo, CFIndex index);
  266. #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_3_1
  267. void GSEventSetHandInfoScale(GSEventRef event, CGFloat denominator);
  268. #endif
  269. #if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_3_0 && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_3_2
  270. void GSEventChangeHandInfoToCancel(GSEventRef event);
  271. #endif
  272. void GSEventDisableHandEventCoalescing(Boolean disableHandCoalescing);
  273. Boolean GSEventIsHandEvent(GSEventRef event);
  274. Boolean GSEventIsChordingHandEvent(GSEventRef event);
  275. // Always returns 1.
  276. int GSEventGetClickCount(GSEventRef event);
  277. #pragma mark -
  278. #pragma mark Scroll wheel and touch events
  279. CGFloat GSEventGetDeltaX(GSEventRef event);
  280. CGFloat GSEventGetDeltaY(GSEventRef event);
  281. #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_3_2
  282. void GSEventSetDeltaX(GSEventRef event, CGFloat deltaX);
  283. void GSEventSetDeltaY(GSEventRef event, CGFloat deltaY);
  284. #endif
  285. #pragma mark -
  286. #pragma mark Keyboard events
  287. unsigned short GSEventGetCharacterSet(GSEventRef event);
  288. GSEventFlags GSEventGetModifierFlags(GSEventRef event);
  289. Boolean GSEventIsKeyRepeating(GSEventRef event);
  290. UniChar GSEventGetKeyCode(GSEventRef event);
  291. #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_3_2
  292. GSEventRef _GSCreateSyntheticKeyEvent(UniChar keycode, Boolean isKeyUp, Boolean isKeyRepeating);
  293. #endif
  294. Boolean GSEventIsKeyCharacterEventType(GSEventRef event, UniChar expected_keycode);
  295. Boolean GSEventIsTabKeyEvent(GSEventRef event);
  296. CFStringRef GSEventCopyCharactersIgnoringModifiers(GSEventRef event);
  297. CFStringRef GSEventCopyCharacters(GSEventRef event);
  298. #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_3_2
  299. void _GSPostSyntheticKeyEvent(CFStringRef keys, Boolean isKeyUp, Boolean isKeyRepeating);
  300. #endif
  301. #pragma mark -
  302. #pragma mark Accelerometer events
  303. CGFloat GSEventAccelerometerAxisX(GSEventRef event);
  304. CGFloat GSEventAccelerometerAxisY(GSEventRef event);
  305. CGFloat GSEventAccelerometerAxisZ(GSEventRef event);
  306. #pragma mark -
  307. #pragma mark Out-of-line data (deprecated)
  308. #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_3_2
  309. void GSEventRequestOutOfLineData(mach_port_t port, void* unknown);
  310. mach_msg_return_t GSEventSendOutOfLineData(mach_port_t port, ...);
  311. #endif
  312. #pragma mark -
  313. #pragma mark Hardware manipulation events
  314. int GSEventDeviceOrientation(GSEventRef event);
  315. void GSEventRotateSimulator(int x); // -1 = home button on the left, 0 = portrait, 1 = home button on the right.
  316. void GSEventRestoreSensitivity();
  317. void GSEventSetSensitivity(int sensitivity); // or float?
  318. void GSEventLockDevice(); // 1014.
  319. void GSEventResetIdleTimer();
  320. void GSEventResetIdleDuration(int a, int b);
  321. void GSEventSetBacklightLevel(float level);
  322. void GSEventSetBacklightFactor(int factor);
  323. #pragma mark -
  324. #pragma mark Application events
  325. Boolean GSEventIsForceQuitEvent(GSEventRef event);
  326. void GSEventQuitTopApplication(); // 2010.
  327. void GSSendAppPreferencesChanged(CFStringRef service_name, CFStringRef app_id);
  328. void GSSendApplicationSuspendedSettingsUpdatedEvent(int x, int y, CFStringRef suspendedDefaultPNG, CFStringRef roleID);
  329. void GSSendApplicationSuspendedEvent(int x, int y, CFStringRef suspendedDefaultPNG, CFStringRef roleID);
  330. void GSEventFinishedActivating(Boolean b) __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0);
  331. void GSEventSendApplicationOpenURL(CFURLRef url, mach_port_t port);
  332. #pragma mark -
  333. #pragma mark Accessory key state events
  334. GSAccessoryKeyStateInfo GSEventGetAccessoryKeyStateInfo(GSEventRef event);
  335. GSEventRef GSEventCreateAccessoryKeyStateEvent(GSEventRef event, GSEventFlags flags);
  336. void GSEventAccessoryKeyStateChanged(unsigned short a, int b, GSEventFlags flags);
  337. void GSEventAccessoryAvailabilityChanged(unsigned short a, int b);
  338. #pragma mark -
  339. #pragma mark Audio events
  340. SInt32 _GSEventGetSoundActionID(CFStringRef path);
  341. void _GSEventPlayAlertOrSystemSoundAtPath(CFStringRef path, Boolean loop, Boolean alert);
  342. SInt32 GSEventPrimeSoundAtPath(CFStringRef path);
  343. void GSEventStopSoundAtPath(CFStringRef path, Boolean unknown);
  344. void GSEventPlayAlertSoundAtPath(CFStringRef path);// Equivalent to _GSEventPlayAlertOrSystemSoundAtPath(path, 0, 1)
  345. void GSEventLoopSoundAtPath(CFStringRef path);// Equivalent to _GSEventPlayAlertOrSystemSoundAtPath(path, 1, 0)
  346. void GSEventPlaySoundAtPath(CFStringRef path);// Equivalent to _GSEventPlayAlertOrSystemSoundAtPath(path, 0, 0)
  347. void GSEventVibrateForDuration(float secs);
  348. void GSEventStopVibrator(); ///< Equivalent to GSEventVibrateForDuration(0)
  349. #pragma mark -
  350. #pragma mark Hardware keyboard events
  351. #if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_3_2
  352. extern const char* kGSEventHardwareKeyboardAvailabilityChangedNotification; // "GSEventHardwareKeyboardAttached"
  353. Boolean GSEventIsHardwareKeyboardAttached(void);
  354. void GSEventSetHardwareKeyboardAttached(Boolean attached);
  355. // "type" must be 10 or 14.
  356. GSEventRef GSEventCreateKeyEvent(GSEventType type,
  357. CGPoint windowLocation,
  358. CFStringRef characters,
  359. CFStringRef unmodifiedCharacters,
  360. GSEventFlags modifiers,
  361. uint16_t usagePage,
  362. unsigned options7, unsigned options8);
  363. void GSSendKeyEvent(GSEventType type,
  364. CGPoint windowLocation,
  365. CFStringRef characters,
  366. CFStringRef unmodifiedCharacters,
  367. GSEventFlags modifiers,
  368. uint16_t usagePage,
  369. unsigned short options7,
  370. unsigned short options8);
  371. uint16_t GSEventGetUsagePage(GSEventRef event);
  372. void GSEventSetCharCode(GSEventRef event, UniChar charCode);
  373. void GSEventSetCharacters(GSEventRef event, CFStringRef characters);
  374. void GSEventSetKeyCode(GSEventRef event, uint16_t keyCode);
  375. void GSEventSetUnmodifiedCharacters(GSEventRef event, CFStringRef characters);
  376. Boolean GSEventIsHardwareKeyboardEvent(GSEventRef event);
  377. Boolean GSEventIsKeyVariant(GSEventRef event);
  378. #endif
  379. #if __cplusplus
  380. }
  381. #endif
  382. #endif