The OpenD Programming Language

GlobalHotkeyManager

Global hotkey manager. It contains static methods to manage global hotkeys.

 try {
	GlobalHotkeyManager.register("M-H-A", delegate () { hideShowWindows(); });
} catch (Exception e) {
	conwriteln("ERROR registering hotkey!");
}
EventLoop.get.run();

The key strings are based on Emacs. In practical terms, M means alt and H means the Windows logo key. C is ctrl.

This is X-specific right now. If you are on Windows, try registerHotKey instead.

We will probably merge these into a single interface later.

Members

Static functions

register
void register(GlobalHotkey gh)
void register(const(char)[] akey, void delegate() ahandler)

Register new global hotkey with initialized GlobalHotkey object. This function will throw if it failed to register hotkey (i.e. hotkey is invalid or already taken).

unregister
void unregister(GlobalHotkey gh)
void unregister(const(char)[] key)

Register new global hotkey with previously used GlobalHotkey object. It is safe to unregister unknown or invalid hotkey.

Meta