Guest User

Untitled

a guest
May 20th, 2018
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. require 'dl/import'
  2. require "dl/struct"
  3.  
  4. module Hotkey
  5. extend DL::Importable
  6. # dlload "Carbon.framework/Frameworks/HIToolbox.framework/HIToolbox"
  7. dlload "Carbon.framework/Carbon"
  8.  
  9. # OSStatus RegisterEventHotKey (
  10. # UInt32 inHotKeyCode,
  11. # UInt32 inHotKeyModifiers,
  12. # EventHotKeyID inHotKeyID,
  13. # EventTargetRef inTarget,
  14. # OptionBits inOptions,
  15. # EventHotKeyRef *outRef
  16. # );
  17.  
  18. typealias("OSStatus", "unsigned long")
  19.  
  20. OSType = struct [
  21. "char a",
  22. "char b",
  23. "char c",
  24. "char d",
  25. ]
  26.  
  27. typealias("UInt32", "unsigned long")
  28.  
  29. EventHotKeyID = struct [
  30. "UInt32 signature",
  31. "UInt32 id"
  32. ]
  33.  
  34. typealias("EventHotKeyID", "void *")
  35. typealias("EventTargetRef", "void *")
  36. typealias("OptionBits", "UInt32")
  37. typealias("EventHotKeyRef", "void **")
  38.  
  39. extern "OSStatus RegisterEventHotKey (
  40. UInt32 inHotKeyCode,
  41. UInt32 inHotKeyModifiers,
  42. EventHotKeyID inHotKeyID,
  43. EventTargetRef inTarget,
  44. OptionBits inOptions,
  45. EventHotKeyRef outRef
  46. )"
  47.  
  48. end
Add Comment
Please, Sign In to add comment