Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'dl/import'
- require "dl/struct"
- module Hotkey
- extend DL::Importable
- # dlload "Carbon.framework/Frameworks/HIToolbox.framework/HIToolbox"
- dlload "Carbon.framework/Carbon"
- # OSStatus RegisterEventHotKey (
- # UInt32 inHotKeyCode,
- # UInt32 inHotKeyModifiers,
- # EventHotKeyID inHotKeyID,
- # EventTargetRef inTarget,
- # OptionBits inOptions,
- # EventHotKeyRef *outRef
- # );
- typealias("OSStatus", "unsigned long")
- OSType = struct [
- "char a",
- "char b",
- "char c",
- "char d",
- ]
- typealias("UInt32", "unsigned long")
- EventHotKeyID = struct [
- "UInt32 signature",
- "UInt32 id"
- ]
- typealias("EventHotKeyID", "void *")
- typealias("EventTargetRef", "void *")
- typealias("OptionBits", "UInt32")
- typealias("EventHotKeyRef", "void **")
- extern "OSStatus RegisterEventHotKey (
- UInt32 inHotKeyCode,
- UInt32 inHotKeyModifiers,
- EventHotKeyID inHotKeyID,
- EventTargetRef inTarget,
- OptionBits inOptions,
- EventHotKeyRef outRef
- )"
- end
Add Comment
Please, Sign In to add comment