!7 sclass SpeechRecogHotKey > DynPrintLog { int keyCode = /*59*/88, modifiers = 0; // F12 bool justOnce = true; start { dm_startKeyLogger(); /*ownResource(onGlobalKeyPress(voidfunc(NativeKeyEvent e) { if (e.getKeyCode() == keyCode && e.getModifiers() == modifiers) { doIt(); } }));*/ ownResource(vmBus_onMessage('keyDown, voidfunc(O[] arg) { int kc = (int) arg[0], mod = (int) arg[1]; if (kc == keyCode && mod == modifiers) doIt(); })); print("Hotkey registered (F12)"); } void doIt { print("Speech hotkey detected"); dm_callModule(dm_makeModule("#1018551/SpeechRecognizer"), justOnce ? 'justOnce : 'startListening); } }