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

13
LINES

< > BotCompany Repo | #1015667 // showChangeHotkeyForm

JavaX fragment (include)

1  
static JPanel showChangeHotkeyForm(fS hotkeyName, S hotkeyDesc) {
2  
  S hot = currentHotKey(hotkeyName);
3  
  final JComboBox cb = jComboBox(concatLists(ll("None"), keys(jNativeHook_keyCodes())));
4  
  selectItem(cb, hot);
5  
  ret showFormTitled("Assign Hotkey",
6  
    "Hotkey description:", jlabel(hotkeyDesc),
7  
    "Current hotkey:", jlabel(or2(hot, "None")),
8  
    "New hotkey:", cb, r {
9  
      S key = nullIfEq("None", selectedItem(cb));
10  
      saveTextFile(hotKey_file(hotkeyName), key);
11  
      infoBox(empty(key) ? "Hotkey removed!" : "Hotkey assigned: " + key);
12  
    });
13  
}

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: #1015667
Snippet name: showChangeHotkeyForm
Eternal ID of this version: #1015667/6
Text MD5: 1e5ba293272774aee78f30ecfdb015c2
Author: stefan
Category: javax / os
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-05-21 12:17:19
Source code size: 572 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 363 / 395
Version history: 5 change(s)
Referenced in: [show references]