key-bindings

Is it possible to enable rules only for specific keyboard layout (karabiner)?

五迷三道 提交于 2020-03-04 15:37:46
问题 On Karabiner I am enabling multiples rules under its complex modifications setup, such as Emacs key bindings . I was wondering is it possible to use those enables rules only for a specific keyboard layout such as U.S. and automatically disable those rules when I switch to an another keyboard layout. 回答1: It's not possible to turn existing imported rules to be device specific. However if you make or modify those rules you can. https://pqrs.org/osx/karabiner/json.html#condition-definition

Is it possible to enable rules only for specific keyboard layout (karabiner)?

£可爱£侵袭症+ 提交于 2020-03-04 15:34:08
问题 On Karabiner I am enabling multiples rules under its complex modifications setup, such as Emacs key bindings . I was wondering is it possible to use those enables rules only for a specific keyboard layout such as U.S. and automatically disable those rules when I switch to an another keyboard layout. 回答1: It's not possible to turn existing imported rules to be device specific. However if you make or modify those rules you can. https://pqrs.org/osx/karabiner/json.html#condition-definition

Java: Use keystroke with arrow key

怎甘沉沦 提交于 2020-01-28 09:50:59
问题 I have some code that I need to modify. In the code, the original author uses KeyStroke.getKeyStroke to take user input. In this code, for example, he uses a instead of left arrow. I want to change this, but I don't know how. Here is the original code: registerKeyboardAction( new ActionListener() { public void actionPerformed(ActionEvent e) { tick(RIGHT); } }, "right", KeyStroke.getKeyStroke('d'), WHEN_IN_FOCUSED_WINDOW ); I have to change it to something like this, but when run, it doesn't

using keybinding and Action Map in Java for shortcut keys for buttons

帅比萌擦擦* 提交于 2020-01-24 21:51:50
问题 I am making a program where I want to have shortcuts for all the buttons in my program. example ctrl+a executes button 1. I also want these shortcuts to be user changeable so this is the code i am using to add a key binding InputMap IM = component.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); IM.put(KeyStroke.getKeyStroke(KeyEvent.VK_B, InputEvent.CTRL_DOWN_MASK | InputEvent.ALT_DOWN_MASK), "BUTTON ONE ID"); ActionMap actionMap = component.getActionMap(); actionMap.put("BUTTON ONE ID", new

using keybinding and Action Map in Java for shortcut keys for buttons

倖福魔咒の 提交于 2020-01-24 21:51:22
问题 I am making a program where I want to have shortcuts for all the buttons in my program. example ctrl+a executes button 1. I also want these shortcuts to be user changeable so this is the code i am using to add a key binding InputMap IM = component.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); IM.put(KeyStroke.getKeyStroke(KeyEvent.VK_B, InputEvent.CTRL_DOWN_MASK | InputEvent.ALT_DOWN_MASK), "BUTTON ONE ID"); ActionMap actionMap = component.getActionMap(); actionMap.put("BUTTON ONE ID", new

How to make JTabbedPane not to catch Ctrl+Tab key binding?

我只是一个虾纸丫 提交于 2020-01-24 21:16:36
问题 When I press Ctrl + Tab , selected tab in JTabbedPane receives focus. But I want to remove this key binding. So I have my own action for key binding Ctrl+Tab. It is assigned to JTabbedPane. But it's not fired because this key binding still focuses current tab. 回答1: So I have my own action for key binding Ctrl+Tab. It is assigned to JTabbedPane. Did you use the proper InputMap when you assigned the Key Binding. Most LAF's will use the JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT InputMap. See

Can't map Ctrl + minus in Emacs in Mac OS X

∥☆過路亽.° 提交于 2020-01-24 17:57:04
问题 I'm trying to map Ctrl + minus ("C--") to undo in Emacs 24.3 (from http://emacsformacosx.com) in Mac OS X 10.8.4, but I can't get it to work. There seems to be some very global key binding for decreasing the font size, which I can't seem to override. Can anyone tell me what I'm doing wrong? I have the following in my .emacs. (global-set-key (kbd "C--") 'undo) ;; Doesn't work (global-set-key (kbd "C-u") 'undo) ;; Just for testing, does work When I press Ctrl+U, it triggers undo, but when I

Binds not working on a specific part

只谈情不闲聊 提交于 2020-01-24 01:01:05
问题 So earlier in my program, I use the line l.bind("<Button-1>",lambda e: getSide(i)) and when I click on the element, it works fine. However, later I use the line l.bind("<Button-1>",lambda e: sortby(x)) for a different local object. getSide is a stub that prints the value of i defined when binding. sortby is a Quicksort that (for debugging purposes) prints the value of x at the start. The curious thing is that while getSide returns the correct value, sortby does not. getSide returns i ,

Tell emacs to interpret words breaking them at newline and whitespace

感情迁移 提交于 2020-01-17 12:15:25
问题 I would like to tell emacs to break "words" when there is a whitespace or a newline (the one used in forward-word). If I use forward-word on this (the cursor is in the capital letter or with a _) _aaaa} {bbbb then I get aaaa} {bbbb_ Since I dislike this behaviour I tried remapping M-f with forward-whitespace. In the above case the cursors places between the two brackets, as I want, but in a case like this _aaaa-bbbb the cursor goes here after a forward-whitespace aaaa-bbbb_ so if I want to go

How to find command by pressing keybinding in VSCode

前提是你 提交于 2020-01-13 08:06:50
问题 I'm looking for a way for vscode to tell me the command name for a keybinding. For example, cmd+a maps to editor.action.selectAll , so ideally I'd press a keyboard shortcut, then cmd+a , then VSCode could tell me editor.action.selectAll . As a partial solution, I can open my keybindings.json and search for cmd+a , but this doesn't work for extensions - my particular use case is figuring out what the vim o command is called so I can remap it. In the Emacs world, this functionality is available