Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

26
LINES

< > BotCompany Repo | #1018560 // Hotkey for Speech Recognition [Dyn Module]

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Libraryless. Click here for Pure Java version (14651L/101K).

!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);
  }
} 

Author comment

Began life as a copy of #1018551

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1018560
Snippet name: Hotkey for Speech Recognition [Dyn Module]
Eternal ID of this version: #1018560/13
Text MD5: c61bc43d6510eebc57bf122c64ed9b00
Transpilation MD5: 38e64f4c3878ce58bd076ae2094d762c
Author: stefan
Category: javax / stefan's os
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-10-30 12:53:27
Source code size: 735 bytes / 26 lines
Pitched / IR pitched: No / No
Views / Downloads: 308 / 2003
Version history: 12 change(s)
Referenced in: [show references]