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

18
LINES

< > BotCompany Repo | #1014805 // NumPadFixingInputMap

JavaX fragment (include)

1  
please include function rsyntaxTextArea_fixNumPad.
2  
3  
sclass NumPadFixingInputMap extends InputMap {
4  
  public void put(KeyStroke keyStroke, Object actionMapKey) {
5  
    super.put(keyStroke, actionMapKey);
6  
    Int code = rsyntaxTextArea_fixNumPad_map.get(keyStroke.getKeyCode());
7  
    if (code != null)
8  
      put(KeyStroke.getKeyStroke(code, keyStroke.getModifiers()), actionMapKey);
9  
  }
10  
  
11  
  void replaceOn(JComponent c) {
12  
    InputMap im = c.getInputMap();
13  
    setParent(im.getParent());
14  
    for (KeyStroke key : im.keys())
15  
      put(key, im.get(key));
16  
    c.setInputMap(JComponent.WHEN_FOCUSED, this);
17  
  }
18  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1014805
Snippet name: NumPadFixingInputMap
Eternal ID of this version: #1014805/3
Text MD5: 356747efae4ca725358985f6724ed620
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-05-03 01:27:20
Source code size: 621 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 317 / 910
Version history: 2 change(s)
Referenced in: [show references]