Created
July 23, 2008 20:26
-
-
Save phurley/1892 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment