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).

1  
!7
2  
3  
sclass SpeechRecogHotKey > DynPrintLog {
4  
  int keyCode = /*59*/88, modifiers = 0; // F12
5  
  bool justOnce = true;
6  
  
7  
  start {
8  
    dm_startKeyLogger();
9  
    /*ownResource(onGlobalKeyPress(voidfunc(NativeKeyEvent e) {
10  
      if (e.getKeyCode() == keyCode && e.getModifiers() == modifiers) {
11  
        doIt();
12  
      }
13  
    }));*/
14  
    ownResource(vmBus_onMessage('keyDown, voidfunc(O[] arg) {
15  
      int kc = (int) arg[0], mod = (int) arg[1];
16  
      if (kc == keyCode && mod == modifiers)
17  
        doIt();
18  
    }));
19  
    print("Hotkey registered (F12)");
20  
  }
21  
22  
  void doIt {
23  
    print("Speech hotkey detected");
24  
    dm_callModule(dm_makeModule("#1018551/SpeechRecognizer"), justOnce ? 'justOnce : 'startListening);
25  
  }
26  
} 

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: 367 / 2081
Version history: 12 change(s)
Referenced in: [show references]