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

9
LINES

< > BotCompany Repo | #1035400 // ctrlLetterKeyListener - e.g. Ctrl+B

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (7916L/44K).

static KeyListener ctrlLetterKeyListener(char letter, Runnable action) {
  ret new KeyAdapter {
    public void keyReleased(KeyEvent ke) {
      if (ke.getKeyCode() == charToKeyCode(letter) && ke.getModifiers() == KeyEvent.CTRL_MASK) {
        pcallF(action);
      }
    }
  };
}

Author comment

Began life as a copy of #1035314

download  show line numbers  debug dex  old transpilations   

Travelled to 2 computer(s): mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1035400
Snippet name: ctrlLetterKeyListener - e.g. Ctrl+B
Eternal ID of this version: #1035400/1
Text MD5: 0d9c0332bbe3b7b1d6f728c3170dfb1c
Transpilation MD5: 77dda065802b99cc2b95366ccc4bb471
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-05-06 14:53:20
Source code size: 288 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 128 / 183
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)