CGEventTypes.pas 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721
  1. { CoreGraphics - CGEventTypes.h
  2. Copyright (c) 2004-2008 Apple Inc.
  3. All rights reserved. }
  4. { Pascal Translation: Peter N Lewis, <[email protected]>, August 2005 }
  5. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2009 }
  6. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2012 }
  7. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, August 2015 }
  8. {
  9. Modified for use with Free Pascal
  10. Version 308
  11. Please report any bugs to <[email protected]>
  12. }
  13. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  14. {$mode macpas}
  15. {$modeswitch cblocks}
  16. {$packenum 1}
  17. {$macro on}
  18. {$inline on}
  19. {$calling mwpascal}
  20. unit CGEventTypes;
  21. interface
  22. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  23. {$setc GAP_INTERFACES_VERSION := $0308}
  24. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  25. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  26. {$endc}
  27. {$ifc defined CPUPOWERPC and defined CPUI386}
  28. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  29. {$endc}
  30. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  31. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  32. {$endc}
  33. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  34. {$setc __ppc__ := 1}
  35. {$elsec}
  36. {$setc __ppc__ := 0}
  37. {$endc}
  38. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  39. {$setc __ppc64__ := 1}
  40. {$elsec}
  41. {$setc __ppc64__ := 0}
  42. {$endc}
  43. {$ifc not defined __i386__ and defined CPUI386}
  44. {$setc __i386__ := 1}
  45. {$elsec}
  46. {$setc __i386__ := 0}
  47. {$endc}
  48. {$ifc not defined __x86_64__ and defined CPUX86_64}
  49. {$setc __x86_64__ := 1}
  50. {$elsec}
  51. {$setc __x86_64__ := 0}
  52. {$endc}
  53. {$ifc not defined __arm__ and defined CPUARM}
  54. {$setc __arm__ := 1}
  55. {$elsec}
  56. {$setc __arm__ := 0}
  57. {$endc}
  58. {$ifc not defined __arm64__ and defined CPUAARCH64}
  59. {$setc __arm64__ := 1}
  60. {$elsec}
  61. {$setc __arm64__ := 0}
  62. {$endc}
  63. {$ifc defined cpu64}
  64. {$setc __LP64__ := 1}
  65. {$elsec}
  66. {$setc __LP64__ := 0}
  67. {$endc}
  68. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  69. {$error Conflicting definitions for __ppc__ and __i386__}
  70. {$endc}
  71. {$ifc defined __ppc__ and __ppc__}
  72. {$setc TARGET_CPU_PPC := TRUE}
  73. {$setc TARGET_CPU_PPC64 := FALSE}
  74. {$setc TARGET_CPU_X86 := FALSE}
  75. {$setc TARGET_CPU_X86_64 := FALSE}
  76. {$setc TARGET_CPU_ARM := FALSE}
  77. {$setc TARGET_CPU_ARM64 := FALSE}
  78. {$setc TARGET_OS_MAC := TRUE}
  79. {$setc TARGET_OS_IPHONE := FALSE}
  80. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  81. {$setc TARGET_OS_EMBEDDED := FALSE}
  82. {$elifc defined __ppc64__ and __ppc64__}
  83. {$setc TARGET_CPU_PPC := FALSE}
  84. {$setc TARGET_CPU_PPC64 := TRUE}
  85. {$setc TARGET_CPU_X86 := FALSE}
  86. {$setc TARGET_CPU_X86_64 := FALSE}
  87. {$setc TARGET_CPU_ARM := FALSE}
  88. {$setc TARGET_CPU_ARM64 := FALSE}
  89. {$setc TARGET_OS_MAC := TRUE}
  90. {$setc TARGET_OS_IPHONE := FALSE}
  91. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  92. {$setc TARGET_OS_EMBEDDED := FALSE}
  93. {$elifc defined __i386__ and __i386__}
  94. {$setc TARGET_CPU_PPC := FALSE}
  95. {$setc TARGET_CPU_PPC64 := FALSE}
  96. {$setc TARGET_CPU_X86 := TRUE}
  97. {$setc TARGET_CPU_X86_64 := FALSE}
  98. {$setc TARGET_CPU_ARM := FALSE}
  99. {$setc TARGET_CPU_ARM64 := FALSE}
  100. {$ifc defined(iphonesim)}
  101. {$setc TARGET_OS_MAC := FALSE}
  102. {$setc TARGET_OS_IPHONE := TRUE}
  103. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  104. {$elsec}
  105. {$setc TARGET_OS_MAC := TRUE}
  106. {$setc TARGET_OS_IPHONE := FALSE}
  107. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  108. {$endc}
  109. {$setc TARGET_OS_EMBEDDED := FALSE}
  110. {$elifc defined __x86_64__ and __x86_64__}
  111. {$setc TARGET_CPU_PPC := FALSE}
  112. {$setc TARGET_CPU_PPC64 := FALSE}
  113. {$setc TARGET_CPU_X86 := FALSE}
  114. {$setc TARGET_CPU_X86_64 := TRUE}
  115. {$setc TARGET_CPU_ARM := FALSE}
  116. {$setc TARGET_CPU_ARM64 := FALSE}
  117. {$ifc defined(iphonesim)}
  118. {$setc TARGET_OS_MAC := FALSE}
  119. {$setc TARGET_OS_IPHONE := TRUE}
  120. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  121. {$elsec}
  122. {$setc TARGET_OS_MAC := TRUE}
  123. {$setc TARGET_OS_IPHONE := FALSE}
  124. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  125. {$endc}
  126. {$setc TARGET_OS_EMBEDDED := FALSE}
  127. {$elifc defined __arm__ and __arm__}
  128. {$setc TARGET_CPU_PPC := FALSE}
  129. {$setc TARGET_CPU_PPC64 := FALSE}
  130. {$setc TARGET_CPU_X86 := FALSE}
  131. {$setc TARGET_CPU_X86_64 := FALSE}
  132. {$setc TARGET_CPU_ARM := TRUE}
  133. {$setc TARGET_CPU_ARM64 := FALSE}
  134. { will require compiler define when/if other Apple devices with ARM cpus ship }
  135. {$setc TARGET_OS_MAC := FALSE}
  136. {$setc TARGET_OS_IPHONE := TRUE}
  137. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  138. {$setc TARGET_OS_EMBEDDED := TRUE}
  139. {$elifc defined __arm64__ and __arm64__}
  140. {$setc TARGET_CPU_PPC := FALSE}
  141. {$setc TARGET_CPU_PPC64 := FALSE}
  142. {$setc TARGET_CPU_X86 := FALSE}
  143. {$setc TARGET_CPU_X86_64 := FALSE}
  144. {$setc TARGET_CPU_ARM := FALSE}
  145. {$setc TARGET_CPU_ARM64 := TRUE}
  146. { will require compiler define when/if other Apple devices with ARM cpus ship }
  147. {$setc TARGET_OS_MAC := FALSE}
  148. {$setc TARGET_OS_IPHONE := TRUE}
  149. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  150. {$setc TARGET_OS_EMBEDDED := TRUE}
  151. {$elsec}
  152. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
  153. {$endc}
  154. {$ifc defined __LP64__ and __LP64__ }
  155. {$setc TARGET_CPU_64 := TRUE}
  156. {$elsec}
  157. {$setc TARGET_CPU_64 := FALSE}
  158. {$endc}
  159. {$ifc defined FPC_BIG_ENDIAN}
  160. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  161. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  162. {$elifc defined FPC_LITTLE_ENDIAN}
  163. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  164. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  165. {$elsec}
  166. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  167. {$endc}
  168. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  169. {$setc CALL_NOT_IN_CARBON := FALSE}
  170. {$setc OLDROUTINENAMES := FALSE}
  171. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  172. {$setc OPAQUE_UPP_TYPES := TRUE}
  173. {$setc OTCARBONAPPLICATION := TRUE}
  174. {$setc OTKERNEL := FALSE}
  175. {$setc PM_USE_SESSION_APIS := TRUE}
  176. {$setc TARGET_API_MAC_CARBON := TRUE}
  177. {$setc TARGET_API_MAC_OS8 := FALSE}
  178. {$setc TARGET_API_MAC_OSX := TRUE}
  179. {$setc TARGET_CARBON := TRUE}
  180. {$setc TARGET_CPU_68K := FALSE}
  181. {$setc TARGET_CPU_MIPS := FALSE}
  182. {$setc TARGET_CPU_SPARC := FALSE}
  183. {$setc TARGET_OS_UNIX := FALSE}
  184. {$setc TARGET_OS_WIN32 := FALSE}
  185. {$setc TARGET_RT_MAC_68881 := FALSE}
  186. {$setc TARGET_RT_MAC_CFM := FALSE}
  187. {$setc TARGET_RT_MAC_MACHO := TRUE}
  188. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  189. {$setc TYPE_BOOL := FALSE}
  190. {$setc TYPE_EXTENDED := FALSE}
  191. {$setc TYPE_LONGLONG := TRUE}
  192. uses MacTypes,MacOSXPosix,CGRemoteOperation,CGBase;
  193. {$endc} {not MACOSALLINCLUDE}
  194. {$ALIGN POWER}
  195. { An opaque type that represents a low-level hardware event.
  196. Low-level hardware events of this type are referred to as Quartz events.
  197. A typical event in Mac OS X originates when the user manipulates an input
  198. device such as a mouse or a keyboard. The device driver associated with
  199. that device, through the I/O Kit, creates a low-level event, puts it in
  200. the window server’s event queue, and notifies the window server. The
  201. window server creates a Quartz event, annotates the event, and dispatches
  202. the event to the appropriate run-loop port of the target process. There
  203. the event is picked up by the Carbon Event Manager and forwarded to the
  204. event-handling mechanism appropriate to the application environment. You
  205. can use event taps to gain access to Quartz events at several different
  206. steps in this process.
  207. This opaque type is derived from `CFType' and inherits the properties
  208. that all Core Foundation types have in common. }
  209. type
  210. CGEventRef = ^__CGEvent; { an opaque type }
  211. __CGEvent = record end;
  212. { Constants that specify buttons on a one, two, or three-button mouse. }
  213. const
  214. kCGMouseButtonLeft = 0;
  215. kCGMouseButtonRight = 1;
  216. kCGMouseButtonCenter = 2;
  217. type
  218. CGMouseButton = UInt32;
  219. { Constants that specify the unit of measurement for a scrolling event. }
  220. const
  221. kCGScrollEventUnitPixel = 0;
  222. kCGScrollEventUnitLine = 1;
  223. type
  224. CGScrollEventUnit = UInt32;
  225. { Constants that specify momentum scroll phases. }
  226. const
  227. kCGMomentumScrollPhaseNone = 0;
  228. kCGMomentumScrollPhaseBegin = 1;
  229. kCGMomentumScrollPhaseContinue = 2;
  230. kCGMomentumScrollPhaseEnd = 3;
  231. type
  232. CGMomentumScrollPhase = UInt32;
  233. { Constants that specify scroll phases. }
  234. const
  235. kCGScrollPhaseBegan = 1;
  236. kCGScrollPhaseChanged = 2;
  237. kCGScrollPhaseEnded = 4;
  238. kCGScrollPhaseCancelled = 8;
  239. kCGScrollPhaseMayBegin = 128;
  240. type
  241. CGScrollPhase = UInt32;
  242. { Constants that specify gesture phases. }
  243. const
  244. kCGGesturePhaseNone = 0;
  245. kCGGesturePhaseBegan = 1;
  246. kCGGesturePhaseChanged = 2;
  247. kCGGesturePhaseEnded = 4;
  248. kCGGesturePhaseCancelled = 8;
  249. kCGGesturePhaseMayBegin = 128;
  250. type
  251. CGGesturePhase = UInt32;
  252. { Constants that indicate the modifier key state at the time an event is
  253. created, as well as other event-related states.
  254. Any bits not specified are reserved for future use. }
  255. (*
  256. Uncomment when IOKit is translated
  257. const { Masks for the bits in event flags }
  258. { Device-independent modifier key bits. }
  259. kCGEventFlagMaskAlphaShift = NX_ALPHASHIFTMASK;
  260. kCGEventFlagMaskShift = NX_SHIFTMASK;
  261. kCGEventFlagMaskControl = NX_CONTROLMASK;
  262. kCGEventFlagMaskAlternate = NX_ALTERNATEMASK;
  263. kCGEventFlagMaskCommand = NX_COMMANDMASK;
  264. { Special key identifiers. }
  265. kCGEventFlagMaskHelp = NX_HELPMASK;
  266. kCGEventFlagMaskSecondaryFn = NX_SECONDARYFNMASK;
  267. { Identifies key events from numeric keypad area on extended keyboards. }
  268. kCGEventFlagMaskNumericPad = NX_NUMERICPADMASK;
  269. { Indicates if mouse/pen movement events are not being coalesced }
  270. kCGEventFlagMaskNonCoalesced = NX_NONCOALSESCEDMASK;
  271. *)
  272. type
  273. CGEventFlags = UInt64; { Flags for events }
  274. { Constants that specify the different types of input events. }
  275. { Event types }
  276. type
  277. _CGEventType = SInt32;
  278. (*
  279. Uncomment when IOKit is translated
  280. const
  281. kCGEventNull = NX_NULLEVENT; { Placeholder; the Null Event }
  282. { mouse events }
  283. kCGEventLeftMouseDown = NX_LMOUSEDOWN; { left mouse-down event }
  284. kCGEventLeftMouseUp = NX_LMOUSEUP; { left mouse-up event }
  285. kCGEventRightMouseDown = NX_RMOUSEDOWN; { right mouse-down event }
  286. kCGEventRightMouseUp = NX_RMOUSEUP; { right mouse-up event }
  287. kCGEventMouseMoved = NX_MOUSEMOVED; { mouse-moved event }
  288. kCGEventLeftMouseDragged = NX_LMOUSEDRAGGED; { left mouse-dragged event }
  289. kCGEventRightMouseDragged = NX_RMOUSEDRAGGED; { right mouse-dragged event }
  290. { keyboard events }
  291. kCGEventKeyDown = NX_KEYDOWN; { key-down event }
  292. kCGEventKeyUp = NX_KEYUP; { key-up event }
  293. kCGEventFlagsChanged = NX_FLAGSCHANGED; { flags-changed (modifier keys and status) event }
  294. { Specialized control devices }
  295. kCGEventScrollWheel = NX_SCROLLWHEELMOVED; { Scroll wheel input device }
  296. kCGEventTabletPointer = NX_TABLETPOINTER; { specialized tablet pointer event, in addition to tablet mouse event }
  297. kCGEventTabletProximity = NX_TABLETPROXIMITY; { specialized tablet proximity event, in addition to tablet mouse event }
  298. kCGEventOtherMouseDown = NX_OMOUSEDOWN; { Mouse button 2-31 down }
  299. kCGEventOtherMouseUp = NX_OMOUSEUP; { Mouse button 2-31 up }
  300. kCGEventOtherMouseDragged = NX_OMOUSEDRAGGED; { Drag with mouse button 2-31 down }
  301. *)
  302. {
  303. * Out of band types, delivered for unusual conditions
  304. * These are delivered to the event tap callback to notify of unusual
  305. * conditions that disable the event tap.
  306. }
  307. const
  308. kCGEventTapDisabledByTimeout = $FFFFFFFE;
  309. kCGEventTapDisabledByUserInput = $FFFFFFFF;
  310. type
  311. CGEventType = UInt32;
  312. { Event timestamp; roughly, nanoseconds since startup. }
  313. type
  314. CGEventTimestamp = UInt64;
  315. { Constants used as keys to access specialized fields in low-level events. }
  316. const
  317. { Key to access an integer field that contains the mouse button event
  318. number. Matching mouse-down and mouse-up events will have the same
  319. event number. }
  320. kCGMouseEventNumber = 0;
  321. { Key to access an integer field that contains the mouse button click
  322. state. A click state of 1 represents a single click. A click state of 2
  323. represents a double-click. A click state of 3 represents a
  324. triple-click. }
  325. kCGMouseEventClickState = 1;
  326. { Key to access a double field that contains the mouse button pressure.
  327. The pressure value may range from 0 to 1, with 0 representing the mouse
  328. being up. This value is commonly set by tablet pens mimicking a
  329. mouse. }
  330. kCGMouseEventPressure = 2;
  331. { Key to access an integer field that contains the mouse button
  332. number. }
  333. kCGMouseEventButtonNumber = 3;
  334. { Key to access an integer field that contains the horizontal mouse delta
  335. since the last mouse movement event. }
  336. kCGMouseEventDeltaX = 4;
  337. { Key to access an integer field that contains the vertical mouse delta
  338. since the last mouse movement event. }
  339. kCGMouseEventDeltaY = 5;
  340. { Key to access an integer field. The value is non-zero if the event
  341. should be ignored by the Inkwell subsystem. }
  342. kCGMouseEventInstantMouser = 6;
  343. { Key to access an integer field that encodes the mouse event subtype as
  344. a `kCFNumberIntType'. }
  345. kCGMouseEventSubtype = 7;
  346. { Key to access an integer field, non-zero when this is an autorepeat of
  347. a key-down, and zero otherwise. }
  348. kCGKeyboardEventAutorepeat = 8;
  349. { Key to access an integer field that contains the virtual keycode of the
  350. key-down or key-up event. }
  351. kCGKeyboardEventKeycode = 9;
  352. { Key to access an integer field that contains the keyboard type
  353. identifier. }
  354. kCGKeyboardEventKeyboardType = 10;
  355. { Key to access an integer field that contains scrolling data. This field
  356. typically contains the change in vertical position since the last
  357. scrolling event from a Mighty Mouse scroller or a single-wheel mouse
  358. scroller. }
  359. kCGScrollWheelEventDeltaAxis1 = 11;
  360. { Key to access an integer field that contains scrolling data. This field
  361. typically contains the change in horizontal position since the last
  362. scrolling event from a Mighty Mouse scroller. }
  363. kCGScrollWheelEventDeltaAxis2 = 12;
  364. { This field is not used. }
  365. kCGScrollWheelEventDeltaAxis3 = 13;
  366. { Key to access a field that contains scrolling data. The scrolling data
  367. represents a line-based or pixel-based change in vertical position
  368. since the last scrolling event from a Mighty Mouse scroller or a
  369. single-wheel mouse scroller. The scrolling data uses a fixed-point
  370. 16.16 signed integer format. If this key is passed to
  371. `CGEventGetDoubleValueField', the fixed-point value is converted to a
  372. double value. }
  373. kCGScrollWheelEventFixedPtDeltaAxis1 = 93;
  374. { Key to access a field that contains scrolling data. The scrolling data
  375. represents a line-based or pixel-based change in horizontal position
  376. since the last scrolling event from a Mighty Mouse scroller. The
  377. scrolling data uses a fixed-point 16.16 signed integer format. If this
  378. key is passed to `CGEventGetDoubleValueField', the fixed-point value is
  379. converted to a double value. }
  380. kCGScrollWheelEventFixedPtDeltaAxis2 = 94;
  381. { This field is not used. }
  382. kCGScrollWheelEventFixedPtDeltaAxis3 = 95;
  383. { Key to access an integer field that contains pixel-based scrolling
  384. data. The scrolling data represents the change in vertical position
  385. since the last scrolling event from a Mighty Mouse scroller or a
  386. single-wheel mouse scroller. }
  387. kCGScrollWheelEventPointDeltaAxis1 = 96;
  388. { Key to access an integer field that contains pixel-based scrolling
  389. data. The scrolling data represents the change in horizontal position
  390. since the last scrolling event from a Mighty Mouse scroller. }
  391. kCGScrollWheelEventPointDeltaAxis2 = 97;
  392. { This field is not used. }
  393. kCGScrollWheelEventPointDeltaAxis3 = 98;
  394. { }
  395. kCGScrollWheelEventScrollPhase = 99;
  396. { rdar://11259169 }
  397. kCGScrollWheelEventScrollCount = 100;
  398. kCGScrollWheelEventMomentumPhase = 123;
  399. { Key to access an integer field that indicates whether the event should
  400. be ignored by the Inkwell subsystem. If the value is non-zero, the
  401. event should be ignored. }
  402. kCGScrollWheelEventInstantMouser = 14;
  403. { Key to access an integer field that contains the absolute X coordinate
  404. in tablet space at full tablet resolution. }
  405. kCGTabletEventPointX = 15;
  406. { Key to access an integer field that contains the absolute Y coordinate
  407. in tablet space at full tablet resolution. }
  408. kCGTabletEventPointY = 16;
  409. { Key to access an integer field that contains the absolute Z coordinate
  410. in tablet space at full tablet resolution. }
  411. kCGTabletEventPointZ = 17;
  412. { Key to access an integer field that contains the tablet button state.
  413. Bit 0 is the first button, and a set bit represents a closed or pressed
  414. button. Up to 16 buttons are supported. }
  415. kCGTabletEventPointButtons = 18;
  416. { Key to access a double field that contains the tablet pen pressure. A
  417. value of 0.0 represents no pressure, and 1.0 represents maximum
  418. pressure. }
  419. kCGTabletEventPointPressure = 19;
  420. { Key to access a double field that contains the horizontal tablet pen
  421. tilt. A value of 0 represents no tilt, and 1 represents maximum tilt. }
  422. kCGTabletEventTiltX = 20;
  423. { Key to access a double field that contains the vertical tablet pen
  424. tilt. A value of 0 represents no tilt, and 1 represents maximum tilt. }
  425. kCGTabletEventTiltY = 21;
  426. { Key to access a double field that contains the tablet pen rotation. }
  427. kCGTabletEventRotation = 22;
  428. { Key to access a double field that contains the tangential pressure on
  429. the device. A value of 0.0 represents no pressure, and 1.0 represents
  430. maximum pressure. }
  431. kCGTabletEventTangentialPressure = 23;
  432. { Key to access an integer field that contains the system-assigned unique
  433. device ID. }
  434. kCGTabletEventDeviceID = 24;
  435. { Key to access an integer field that contains a vendor-specified value. }
  436. kCGTabletEventVendor1 = 25;
  437. { Key to access an integer field that contains a vendor-specified value. }
  438. kCGTabletEventVendor2 = 26;
  439. { Key to access an integer field that contains a vendor-specified value. }
  440. kCGTabletEventVendor3 = 27;
  441. { Key to access an integer field that contains the vendor-defined ID,
  442. typically the USB vendor ID. }
  443. kCGTabletProximityEventVendorID = 28;
  444. { Key to access an integer field that contains the vendor-defined tablet
  445. ID, typically the USB product ID. }
  446. kCGTabletProximityEventTabletID = 29;
  447. { Key to access an integer field that contains the vendor-defined ID of
  448. the pointing device. }
  449. kCGTabletProximityEventPointerID = 30;
  450. { Key to access an integer field that contains the system-assigned device
  451. ID. }
  452. kCGTabletProximityEventDeviceID = 31;
  453. { Key to access an integer field that contains the system-assigned unique
  454. tablet ID. }
  455. kCGTabletProximityEventSystemTabletID = 32;
  456. { Key to access an integer field that contains the vendor-assigned
  457. pointer type. }
  458. kCGTabletProximityEventVendorPointerType = 33;
  459. { Key to access an integer field that contains the vendor-defined pointer
  460. serial number. }
  461. kCGTabletProximityEventVendorPointerSerialNumber = 34;
  462. { Key to access an integer field that contains the vendor-defined unique
  463. ID. }
  464. kCGTabletProximityEventVendorUniqueID = 35;
  465. { Key to access an integer field that contains the device capabilities
  466. mask. }
  467. kCGTabletProximityEventCapabilityMask = 36;
  468. { Key to access an integer field that contains the pointer type. }
  469. kCGTabletProximityEventPointerType = 37;
  470. { Key to access an integer field that indicates whether the pen is in
  471. proximity to the tablet. The value is non-zero if the pen is in
  472. proximity to the tablet and zero when leaving the tablet. }
  473. kCGTabletProximityEventEnterProximity = 38;
  474. { Key to access a field that contains the event target process serial
  475. number. The value is a 64-bit value. }
  476. kCGEventTargetProcessSerialNumber = 39;
  477. { Key to access a field that contains the event target Unix process ID. }
  478. kCGEventTargetUnixProcessID = 40;
  479. { Key to access a field that contains the event source Unix process ID. }
  480. kCGEventSourceUnixProcessID = 41;
  481. { Key to access a field that contains the event source user-supplied
  482. data, up to 64 bits. }
  483. kCGEventSourceUserData = 42;
  484. { Key to access a field that contains the event source Unix effective
  485. UID. }
  486. kCGEventSourceUserID = 43;
  487. { Key to access a field that contains the event source Unix effective
  488. GID. }
  489. kCGEventSourceGroupID = 44;
  490. { Key to access a field that contains the event source state ID used to
  491. create this event. }
  492. kCGEventSourceStateID = 45;
  493. { Key to access an integer field that indicates whether a scrolling event
  494. contains continuous, pixel-based scrolling data. The value is non-zero
  495. when the scrolling data is pixel-based and zero when the scrolling data
  496. is line-based. }
  497. kCGScrollWheelEventIsContinuous = 88;
  498. { Added in 10.5; made public in 10.7 }
  499. kCGMouseEventWindowUnderMousePointer = 91;
  500. kCGMouseEventWindowUnderMousePointerThatCanHandleThisEvent = 92;
  501. type
  502. CGEventField = UInt32;
  503. { Constants used with the `kCGMouseEventSubtype' event field. }
  504. const
  505. kCGEventMouseSubtypeDefault = 0;
  506. kCGEventMouseSubtypeTabletPoint = 1;
  507. kCGEventMouseSubtypeTabletProximity = 2;
  508. type
  509. CGEventMouseSubtype = UInt32;
  510. { Constants that specify possible tapping points for events. }
  511. const
  512. kCGHIDEventTap = 0;
  513. kCGSessionEventTap = 1;
  514. kCGAnnotatedSessionEventTap = 2;
  515. type
  516. CGEventTapLocation = UInt32;
  517. { Constants that specify where a new event tap is inserted into the list of
  518. active event taps. }
  519. const
  520. kCGHeadInsertEventTap = 0;
  521. kCGTailAppendEventTap = 1;
  522. type
  523. CGEventTapPlacement = UInt32;
  524. { Constants that specify whether a new event tap is an active filter or a
  525. passive listener. }
  526. const
  527. kCGEventTapOptionDefault = $00000000;
  528. kCGEventTapOptionListenOnly = $00000001;
  529. type
  530. CGEventTapOptions = UInt32;
  531. { A mask that identifies the set of Quartz events to be observed in an
  532. event tap. }
  533. type
  534. CGEventMask = UInt64;
  535. {
  536. Generate an event mask for a single type of event.
  537. #define CGEventMaskBit(eventType) ((CGEventMask)1 << (eventType))
  538. }
  539. { Generate an event mask for a single type of event.
  540. #define kCGEventMaskForAllEvents (~(CGEventMask)0)
  541. }
  542. const
  543. kCGEventMaskForAllEvents = UInt64($FFFFFFFFFFFFFFFF);
  544. { An opaque type that represents state within the client application that’s
  545. associated with an event tap. }
  546. type
  547. CGEventTapProxy = ^__CGEventTapProxy; { an opaque type }
  548. __CGEventTapProxy = record end;
  549. { A client-supplied callback function that’s invoked whenever an associated
  550. event tap receives a Quartz event.
  551. The callback is passed a proxy for the tap, the event type, the incoming
  552. event, and the user-defined data specified when the event tap was
  553. created. The function should return the (possibly modified) passed-in
  554. event, a newly constructed event, or NULL if the event is to be deleted.
  555. The event passed to the callback is retained by the calling code, and is
  556. released after the callback returns and the data is passed back to the
  557. event system. If a different event is returned by the callback function,
  558. then that event will be released by the calling code along with the
  559. original event, after the event data has been passed back to the event
  560. system. }
  561. type
  562. CGEventTapCallBack = function( proxy: CGEventTapProxy; typ: CGEventType; event: CGEventRef; userInfo: UnivPtr ): CGEventRef;
  563. { When an event tap is installed or released, a notification is posted. See
  564. notify(3) and notify.h for details. }
  565. const
  566. kCGNotifyEventTapAdded = 'com.apple.coregraphics.eventTapAdded';
  567. const
  568. kCGNotifyEventTapRemoved = 'com.apple.coregraphics.eventTapRemoved';
  569. { The structure used to report information about event taps. }
  570. type
  571. CGEventTapInformationPtr = ^CGEventTapInformation;
  572. CGEventTapInformation = record
  573. eventTapID: UInt32;
  574. tapPoint: CGEventTapLocation; { HID, session, annotated session }
  575. options: CGEventTapOptions; { Listener, filter }
  576. {$ifc TARGET_CPU_64}
  577. __alignment_dummy: UInt32;
  578. {$endc}
  579. eventsOfInterest: CGEventMask; { Mask of events being tapped }
  580. tappingProcess: pid_t; { Process that is tapping events }
  581. processBeingTapped: pid_t; { Zero if not a per-process tap }
  582. enabled: CBool; { True if tap is enabled }
  583. minUsecLatency: Float32; { Minimum latency in microseconds }
  584. avgUsecLatency: Float32; { Average latency in microseconds }
  585. maxUsecLatency: Float32; { Maximum latency in microseconds }
  586. end;
  587. __CGEventTapInformation = CGEventTapInformation;
  588. { An opaque type that represents the source of a Quartz event. }
  589. type
  590. CGEventSourceRef = ^__CGEventSource; { an opaque type }
  591. __CGEventSource = record end;
  592. { Constants that specify the possible source states of an event source. }
  593. const
  594. kCGEventSourceStatePrivate = -1;
  595. kCGEventSourceStateCombinedSessionState = 0;
  596. kCGEventSourceStateHIDSystemState = 1;
  597. type
  598. CGEventSourceStateID = UInt32;
  599. { A code that represents the type of keyboard used with a specified event
  600. source. }
  601. type
  602. CGEventSourceKeyboardType = UInt32;
  603. { A constant specifying any input event type }
  604. const
  605. kCGAnyInputEventType = $FFFFFFFF;
  606. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  607. end.
  608. {$endc} {not MACOSALLINCLUDE}