NSEvent.inc 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438
  1. { Parsed from AppKit.framework NSEvent.h }
  2. {$ifdef TYPES}
  3. type
  4. NSEventPtr = ^NSEvent;
  5. {$endif}
  6. {$ifdef TYPES}
  7. type
  8. NSEventType = NSUInteger;
  9. NSEventTypePtr = ^NSEventType;
  10. const
  11. NSLeftMouseDown = 1;
  12. NSLeftMouseUp = 2;
  13. NSRightMouseDown = 3;
  14. NSRightMouseUp = 4;
  15. NSMouseMoved = 5;
  16. NSLeftMouseDragged = 6;
  17. NSRightMouseDragged = 7;
  18. NSMouseEntered = 8;
  19. NSMouseExited = 9;
  20. NSKeyDown = 10;
  21. NSKeyUp = 11;
  22. NSFlagsChanged = 12;
  23. NSAppKitDefined = 13;
  24. NSSystemDefined = 14;
  25. NSApplicationDefined = 15;
  26. NSPeriodic = 16;
  27. NSCursorUpdate = 17;
  28. NSScrollWheel = 22;
  29. NSTabletPoint = 23;
  30. NSTabletProximity = 24;
  31. NSOtherMouseDown = 25;
  32. NSOtherMouseUp = 26;
  33. NSOtherMouseDragged = 27;
  34. NSEventTypeGesture = 29 { available in 10_5 };
  35. NSEventTypeMagnify = 30 { available in 10_5 };
  36. NSEventTypeSwipe = 31 { available in 10_5 };
  37. NSEventTypeRotate = 18 { available in 10_5 };
  38. NSEventTypeBeginGesture = 19 { available in 10_5 };
  39. NSEventTypeEndGesture = 20 { available in 10_5 };
  40. {$if defined(__LP64__)}
  41. NSEventTypeSmartMagnify = 32 { available in 10_8 };
  42. {$endif}
  43. NSEventTypeQuickLook = 33 { available in 10_8 };
  44. type
  45. NSEventMask = culonglong;
  46. NSEventMaskPtr = ^NSEventMask;
  47. const
  48. NSLeftMouseDownMask = 1 shl NSLeftMouseDown;
  49. NSLeftMouseUpMask = 1 shl NSLeftMouseUp;
  50. NSRightMouseDownMask = 1 shl NSRightMouseDown;
  51. NSRightMouseUpMask = 1 shl NSRightMouseUp;
  52. NSMouseMovedMask = 1 shl NSMouseMoved;
  53. NSLeftMouseDraggedMask = 1 shl NSLeftMouseDragged;
  54. NSRightMouseDraggedMask = 1 shl NSRightMouseDragged;
  55. NSMouseEnteredMask = 1 shl NSMouseEntered;
  56. NSMouseExitedMask = 1 shl NSMouseExited;
  57. NSKeyDownMask = 1 shl NSKeyDown;
  58. NSKeyUpMask = 1 shl NSKeyUp;
  59. NSFlagsChangedMask = 1 shl NSFlagsChanged;
  60. NSAppKitDefinedMask = 1 shl NSAppKitDefined;
  61. NSSystemDefinedMask = 1 shl NSSystemDefined;
  62. NSApplicationDefinedMask = 1 shl NSApplicationDefined;
  63. NSPeriodicMask = 1 shl NSPeriodic;
  64. NSCursorUpdateMask = 1 shl NSCursorUpdate;
  65. NSScrollWheelMask = 1 shl NSScrollWheel;
  66. NSTabletPointMask = 1 shl NSTabletPoint;
  67. NSTabletProximityMask = 1 shl NSTabletProximity;
  68. NSOtherMouseDownMask = 1 shl NSOtherMouseDown;
  69. NSOtherMouseUpMask = 1 shl NSOtherMouseUp;
  70. NSOtherMouseDraggedMask = 1 shl NSOtherMouseDragged;
  71. NSEventMaskGesture = 1 shl NSEventTypeGesture { available in 10_5 };
  72. NSEventMaskMagnify = 1 shl NSEventTypeMagnify { available in 10_5 };
  73. NSEventMaskSwipe = 1 shl NSEventTypeSwipe { available in 10_5 };
  74. NSEventMaskRotate = 1 shl NSEventTypeRotate { available in 10_5 };
  75. NSEventMaskBeginGesture = 1 shl NSEventTypeBeginGesture { available in 10_5 };
  76. NSEventMaskEndGesture = 1 shl NSEventTypeEndGesture { available in 10_5 };
  77. {$if defined(__LP64__)}
  78. NSEventMaskSmartMagnify = 1 shl NSEventTypeSmartMagnify { available in 10_8 };
  79. {$endif}
  80. NSAnyEventMask = NSUIntegerMax;
  81. {$endif}
  82. {$ifdef TYPES}
  83. type
  84. NSEventModifierFlags = NSUInteger;
  85. NSEventModifierFlagsPtr = ^NSEventModifierFlags;
  86. const
  87. NSAlphaShiftKeyMask = 1 shl 16;
  88. NSShiftKeyMask = 1 shl 17;
  89. NSControlKeyMask = 1 shl 18;
  90. NSAlternateKeyMask = 1 shl 19;
  91. NSCommandKeyMask = 1 shl 20;
  92. NSNumericPadKeyMask = 1 shl 21;
  93. NSHelpKeyMask = 1 shl 22;
  94. NSFunctionKeyMask = 1 shl 23;
  95. NSDeviceIndependentModifierFlagsMask = $ffff0000;
  96. type
  97. NSPointingDeviceType = NSUInteger;
  98. NSPointingDeviceTypePtr = ^NSPointingDeviceType;
  99. const
  100. NSUnknownPointingDevice = NX_TABLET_POINTER_UNKNOWN;
  101. NSPenPointingDevice = NX_TABLET_POINTER_PEN;
  102. NSCursorPointingDevice = NX_TABLET_POINTER_CURSOR;
  103. NSEraserPointingDevice = NX_TABLET_POINTER_ERASER;
  104. type
  105. NSEventButtonMask = NSUInteger;
  106. NSEventButtonMaskPtr = ^NSEventButtonMask;
  107. const
  108. NSPenTipMask = NX_TABLET_BUTTON_PENTIPMASK;
  109. NSPenLowerSideMask = NX_TABLET_BUTTON_PENLOWERSIDEMASK;
  110. NSPenUpperSideMask = NX_TABLET_BUTTON_PENUPPERSIDEMASK;
  111. type
  112. NSEventPhase = NSUInteger;
  113. NSEventPhasePtr = ^NSEventPhase;
  114. const
  115. NSEventPhaseNone = 0;
  116. NSEventPhaseBegan = $1 shl 0;
  117. NSEventPhaseStationary = $1 shl 1;
  118. NSEventPhaseChanged = $1 shl 2;
  119. NSEventPhaseEnded = $1 shl 3;
  120. NSEventPhaseCancelled = $1 shl 4;
  121. NSEventPhaseMayBegin = $1 shl 5;
  122. type
  123. NSEventGestureAxis = NSInteger;
  124. NSEventGestureAxisPtr = ^NSEventGestureAxis;
  125. const
  126. NSEventGestureAxisNone = 0;
  127. NSEventGestureAxisHorizontal = 1;
  128. NSEventGestureAxisVertical = 2;
  129. type
  130. NSEventSwipeTrackingOptions = NSUInteger;
  131. NSEventSwipeTrackingOptionsPtr = ^NSEventSwipeTrackingOptions;
  132. const
  133. NSEventSwipeTrackingLockDirection = $1 shl 0;
  134. NSEventSwipeTrackingClampGestureAmount = $1 shl 1;
  135. type
  136. NSEventSubtype = cshort;
  137. NSEventSubtypePtr = ^NSEventSubtype;
  138. const
  139. NSWindowExposedEventType = 0;
  140. NSApplicationActivatedEventType = 1;
  141. NSApplicationDeactivatedEventType = 2;
  142. NSWindowMovedEventType = 4;
  143. NSScreenChangedEventType = 8;
  144. NSAWTEventType = 16;
  145. NSPowerOffEventType = 1;
  146. NSMouseEventSubtype = NX_SUBTYPE_DEFAULT;
  147. NSTabletPointEventSubtype = NX_SUBTYPE_TABLET_POINT;
  148. NSTabletProximityEventSubtype = NX_SUBTYPE_TABLET_PROXIMITY;
  149. NSTouchEventSubtype = NX_SUBTYPE_MOUSE_TOUCH { available in 10_6 };
  150. {$endif}
  151. {$ifdef CLASSES}
  152. type
  153. NSEvent = objcclass external (NSObject, NSCopyingProtocol, NSCodingProtocol)
  154. private
  155. _type: NSEventType;
  156. _location: NSPoint;
  157. _modifierFlags: cuint;
  158. _WSTimestamp: id;
  159. _timestamp: NSTimeInterval;
  160. _windowNumber: NSInteger;
  161. _window: NSWindow;
  162. _context: NSGraphicsContext;
  163. _data: record
  164. case longint of
  165. 0: (
  166. mouse: record
  167. eventNumber: cint;
  168. clickCount: cint;
  169. pressure: single;
  170. {$if defined(__LP64__)}
  171. deltaX: CGFloat;
  172. deltaY: CGFloat;
  173. subtype: cint;
  174. buttonNumber: cshort;
  175. reserved1: cshort;
  176. reserved2:array[0..2] of cint;
  177. {$endif}
  178. end;
  179. );
  180. 1: (
  181. key: record
  182. keys: NSString;
  183. unmodKeys: NSString;
  184. keyCode: cushort;
  185. isARepeat: ObjCBOOL;
  186. {$if defined(__LP64__)}
  187. eventFlags: cint;
  188. reserved:array[0..4] of cint;
  189. {$endif}
  190. end;
  191. );
  192. 2: (
  193. tracking: record
  194. eventNumber_: cint;
  195. trackingNumber: NSInteger;
  196. userData: pointer;
  197. {$if defined(__LP64__)}
  198. reserved_:array[0..5] of cint;
  199. {$endif}
  200. end;
  201. );
  202. 3: (
  203. scrollWheel: record
  204. deltaX_: CGFloat;
  205. deltaY_: CGFloat;
  206. deltaZ: CGFloat;
  207. {$if defined(__LP64__)}
  208. subtype_: cshort;
  209. reserved1_: cshort;
  210. reserved2_:array[0..5] of cint;
  211. {$endif}
  212. end;
  213. );
  214. 4: (
  215. axisGesture: record
  216. deltaX_: CGFloat;
  217. deltaY_: CGFloat;
  218. deltaZ_: CGFloat;
  219. {$if defined(__LP64__)}
  220. reserved_:array[0..6] of cint;
  221. {$endif}
  222. end;
  223. );
  224. 5: (
  225. miscGesture: record
  226. subtype_: cshort;
  227. gestureEnded: ObjCBOOL;
  228. reserved_: ObjCBOOL;
  229. value: cint;
  230. percentage: single;
  231. {$if defined(__LP64__)}
  232. reserved2_:array[0..6] of cint;
  233. {$endif}
  234. end;
  235. );
  236. 6: (
  237. misc: record
  238. subtype_: cint;
  239. data1: NSInteger;
  240. data2: NSInteger;
  241. {$if defined(__LP64__)}
  242. reserved_:array[0..5] of cint;
  243. {$endif}
  244. end;
  245. );
  246. {$if defined(__LP64__)}
  247. 7: (
  248. tabletPointData:array[0..13] of cint;
  249. tabletProximityData:array[0..13] of cint;
  250. );
  251. {$endif}
  252. end;
  253. _eventRef: pointer;
  254. {$if defined(__LP64__)}
  255. reserved1: pointer;
  256. reserved2: pointer;
  257. {$endif}
  258. public
  259. function type_: NSEventType; message 'type';
  260. function modifierFlags: NSEventModifierFlags; message 'modifierFlags';
  261. function timestamp: NSTimeInterval; message 'timestamp';
  262. function window: NSWindow; message 'window';
  263. function windowNumber: NSInteger; message 'windowNumber';
  264. function context: NSGraphicsContext; message 'context';
  265. function clickCount: NSInteger; message 'clickCount';
  266. function buttonNumber: NSInteger; message 'buttonNumber';
  267. function eventNumber: NSInteger; message 'eventNumber';
  268. function pressure: single; message 'pressure';
  269. function locationInWindow: NSPoint; message 'locationInWindow';
  270. function deltaX: CGFloat; message 'deltaX';
  271. function deltaY: CGFloat; message 'deltaY';
  272. function deltaZ: CGFloat; message 'deltaZ';
  273. function hasPreciseScrollingDeltas: ObjCBOOL; message 'hasPreciseScrollingDeltas';
  274. function scrollingDeltaX: CGFloat; message 'scrollingDeltaX';
  275. function scrollingDeltaY: CGFloat; message 'scrollingDeltaY';
  276. function momentumPhase: NSEventPhase; message 'momentumPhase';
  277. function isDirectionInvertedFromDevice: ObjCBOOL; message 'isDirectionInvertedFromDevice';
  278. function characters: NSString; message 'characters';
  279. function charactersIgnoringModifiers: NSString; message 'charactersIgnoringModifiers';
  280. function isARepeat: ObjCBOOL; message 'isARepeat';
  281. function keyCode: cushort; message 'keyCode';
  282. function trackingNumber: NSInteger; message 'trackingNumber';
  283. function userData: pointer; message 'userData';
  284. function trackingArea: NSTrackingArea; message 'trackingArea';
  285. function subtype: NSEventSubtype; message 'subtype';
  286. function data1: NSInteger; message 'data1';
  287. function data2: NSInteger; message 'data2';
  288. function eventRef: pointer; message 'eventRef';
  289. class function eventWithEventRef (eventRef_: pointer): NSEvent; message 'eventWithEventRef:'; { available in 10_5 }
  290. function CGEvent: CGEventRef; message 'CGEvent';
  291. class function eventWithCGEvent (cgEvent_: CGEventRef): NSEvent; message 'eventWithCGEvent:'; { available in 10_5 }
  292. class procedure setMouseCoalescingEnabled (flag: ObjCBOOL); message 'setMouseCoalescingEnabled:'; { available in 10_5 }
  293. class function isMouseCoalescingEnabled: ObjCBOOL; message 'isMouseCoalescingEnabled'; { available in 10_5 }
  294. function magnification: CGFloat; message 'magnification';
  295. function deviceID: NSUInteger; message 'deviceID';
  296. function rotation: single; message 'rotation';
  297. function absoluteX: NSInteger; message 'absoluteX';
  298. function absoluteY: NSInteger; message 'absoluteY';
  299. function absoluteZ: NSInteger; message 'absoluteZ';
  300. function buttonMask: NSEventButtonMask; message 'buttonMask';
  301. function tilt: NSPoint; message 'tilt';
  302. function tangentialPressure: single; message 'tangentialPressure';
  303. function vendorDefined: id; message 'vendorDefined';
  304. function vendorID: NSUInteger; message 'vendorID';
  305. function tabletID: NSUInteger; message 'tabletID';
  306. function pointingDeviceID: NSUInteger; message 'pointingDeviceID';
  307. function systemTabletID: NSUInteger; message 'systemTabletID';
  308. function vendorPointingDeviceType: NSUInteger; message 'vendorPointingDeviceType';
  309. function pointingDeviceSerialNumber: NSUInteger; message 'pointingDeviceSerialNumber';
  310. function uniqueID: culonglong; message 'uniqueID';
  311. function capabilityMask: NSUInteger; message 'capabilityMask';
  312. function pointingDeviceType: NSPointingDeviceType; message 'pointingDeviceType';
  313. function isEnteringProximity: ObjCBOOL; message 'isEnteringProximity';
  314. function touchesMatchingPhase_inView (phase: NSTouchPhase; view: NSView): NSSet; message 'touchesMatchingPhase:inView:'; { available in 10_6 }
  315. function phase: NSEventPhase; message 'phase';
  316. class function isSwipeTrackingFromScrollEventsEnabled: ObjCBOOL; message 'isSwipeTrackingFromScrollEventsEnabled'; { available in 10_7 }
  317. procedure trackSwipeEventWithOptions_dampenAmountThresholdMin_max_usingHandler (options: NSEventSwipeTrackingOptions; minDampenThreshold: CGFloat; maxDampenThreshold: CGFloat; trackingHandler: OpaqueCBlock); message 'trackSwipeEventWithOptions:dampenAmountThresholdMin:max:usingHandler:'; { available in 10_7 }
  318. class procedure startPeriodicEventsAfterDelay_withPeriod (delay: NSTimeInterval; period: NSTimeInterval); message 'startPeriodicEventsAfterDelay:withPeriod:';
  319. class procedure stopPeriodicEvents; message 'stopPeriodicEvents';
  320. class function mouseEventWithType_location_modifierFlags_timestamp_windowNumber_context_eventNumber_clickCount_pressure (type_: NSEventType; location: NSPoint; flags: NSEventModifierFlags; time: NSTimeInterval; wNum: NSInteger; context_: NSGraphicsContext; eNum: NSInteger; cNum: NSInteger; pressure_: single): NSEvent; message 'mouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure:';
  321. class function keyEventWithType_location_modifierFlags_timestamp_windowNumber_context_characters_charactersIgnoringModifiers_isARepeat_keyCode (type_: NSEventType; location: NSPoint; flags: NSEventModifierFlags; time: NSTimeInterval; wNum: NSInteger; context_: NSGraphicsContext; keys: NSString; ukeys: NSString; flag: ObjCBOOL; code: cushort): NSEvent; message 'keyEventWithType:location:modifierFlags:timestamp:windowNumber:context:characters:charactersIgnoringModifiers:isARepeat:keyCode:';
  322. class function enterExitEventWithType_location_modifierFlags_timestamp_windowNumber_context_eventNumber_trackingNumber_userData (type_: NSEventType; location: NSPoint; flags: NSEventModifierFlags; time: NSTimeInterval; wNum: NSInteger; context_: NSGraphicsContext; eNum: NSInteger; tNum: NSInteger; data: pointer): NSEvent; message 'enterExitEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:trackingNumber:userData:';
  323. class function otherEventWithType_location_modifierFlags_timestamp_windowNumber_context_subtype_data1_data2 (type_: NSEventType; location: NSPoint; flags: NSEventModifierFlags; time: NSTimeInterval; wNum: NSInteger; context_: NSGraphicsContext; subtype_: cshort; d1: NSInteger; d2: NSInteger): NSEvent; message 'otherEventWithType:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:';
  324. class function mouseLocation: NSPoint; message 'mouseLocation';
  325. class function classModifierFlags: NSEventModifierFlags; message 'modifierFlags'; { available in 10_6 }
  326. class function pressedMouseButtons: NSUInteger; message 'pressedMouseButtons'; { available in 10_6 }
  327. class function doubleClickInterval: NSTimeInterval; message 'doubleClickInterval'; { available in 10_6 }
  328. class function keyRepeatDelay: NSTimeInterval; message 'keyRepeatDelay'; { available in 10_6 }
  329. class function keyRepeatInterval: NSTimeInterval; message 'keyRepeatInterval'; { available in 10_6 }
  330. class function addGlobalMonitorForEventsMatchingMask_handler (mask: NSEventMask; block: OpaqueCBlock): id; message 'addGlobalMonitorForEventsMatchingMask:handler:'; { available in 10_6 }
  331. class function addLocalMonitorForEventsMatchingMask_handler (mask: NSEventMask; block: OpaqueCBlock): id; message 'addLocalMonitorForEventsMatchingMask:handler:'; { available in 10_6 }
  332. class procedure removeMonitor (eventMonitor: id); message 'removeMonitor:'; { available in 10_6 }
  333. { Adopted protocols }
  334. function copyWithZone (zone: NSZonePtr): id; message 'copyWithZone:';
  335. procedure encodeWithCoder (aCoder: NSCoder); message 'encodeWithCoder:';
  336. function initWithCoder (aDecoder: NSCoder): id; message 'initWithCoder:';
  337. end;
  338. {$endif}
  339. {$ifdef TYPES}
  340. const
  341. NSUpArrowFunctionKey = $F700;
  342. NSDownArrowFunctionKey = $F701;
  343. NSLeftArrowFunctionKey = $F702;
  344. NSRightArrowFunctionKey = $F703;
  345. NSF1FunctionKey = $F704;
  346. NSF2FunctionKey = $F705;
  347. NSF3FunctionKey = $F706;
  348. NSF4FunctionKey = $F707;
  349. NSF5FunctionKey = $F708;
  350. NSF6FunctionKey = $F709;
  351. NSF7FunctionKey = $F70A;
  352. NSF8FunctionKey = $F70B;
  353. NSF9FunctionKey = $F70C;
  354. NSF10FunctionKey = $F70D;
  355. NSF11FunctionKey = $F70E;
  356. NSF12FunctionKey = $F70F;
  357. NSF13FunctionKey = $F710;
  358. NSF14FunctionKey = $F711;
  359. NSF15FunctionKey = $F712;
  360. NSF16FunctionKey = $F713;
  361. NSF17FunctionKey = $F714;
  362. NSF18FunctionKey = $F715;
  363. NSF19FunctionKey = $F716;
  364. NSF20FunctionKey = $F717;
  365. NSF21FunctionKey = $F718;
  366. NSF22FunctionKey = $F719;
  367. NSF23FunctionKey = $F71A;
  368. NSF24FunctionKey = $F71B;
  369. NSF25FunctionKey = $F71C;
  370. NSF26FunctionKey = $F71D;
  371. NSF27FunctionKey = $F71E;
  372. NSF28FunctionKey = $F71F;
  373. NSF29FunctionKey = $F720;
  374. NSF30FunctionKey = $F721;
  375. NSF31FunctionKey = $F722;
  376. NSF32FunctionKey = $F723;
  377. NSF33FunctionKey = $F724;
  378. NSF34FunctionKey = $F725;
  379. NSF35FunctionKey = $F726;
  380. NSInsertFunctionKey = $F727;
  381. NSDeleteFunctionKey = $F728;
  382. NSHomeFunctionKey = $F729;
  383. NSBeginFunctionKey = $F72A;
  384. NSEndFunctionKey = $F72B;
  385. NSPageUpFunctionKey = $F72C;
  386. NSPageDownFunctionKey = $F72D;
  387. NSPrintScreenFunctionKey = $F72E;
  388. NSScrollLockFunctionKey = $F72F;
  389. NSPauseFunctionKey = $F730;
  390. NSSysReqFunctionKey = $F731;
  391. NSBreakFunctionKey = $F732;
  392. NSResetFunctionKey = $F733;
  393. NSStopFunctionKey = $F734;
  394. NSMenuFunctionKey = $F735;
  395. NSUserFunctionKey = $F736;
  396. NSSystemFunctionKey = $F737;
  397. NSPrintFunctionKey = $F738;
  398. NSClearLineFunctionKey = $F739;
  399. NSClearDisplayFunctionKey = $F73A;
  400. NSInsertLineFunctionKey = $F73B;
  401. NSDeleteLineFunctionKey = $F73C;
  402. NSInsertCharFunctionKey = $F73D;
  403. NSDeleteCharFunctionKey = $F73E;
  404. NSPrevFunctionKey = $F73F;
  405. NSNextFunctionKey = $F740;
  406. NSSelectFunctionKey = $F741;
  407. NSExecuteFunctionKey = $F742;
  408. NSUndoFunctionKey = $F743;
  409. NSRedoFunctionKey = $F744;
  410. NSFindFunctionKey = $F745;
  411. NSHelpFunctionKey = $F746;
  412. NSModeSwitchFunctionKey = $F747;
  413. {$endif}