key-bindings

Key binding to wrap a selection with an html tag in VSCode

ぃ、小莉子 提交于 2019-12-20 10:36:15
问题 Is there a default key binding in VSCode to wrap a selection in an HTML tag like the keyboard shortcut Shift+alt+W in Visual studio 2015? I could not find anything similar in documentation or in the default keyboard shortcuts that indicates its availability out of the box. 回答1: To automate this go to. File > Preferences > Keyboard Shortcuts and add this into your keybindings.json (right hand side window) { "key": "ctrl+shift+enter", "command": "editor.emmet.action.wrapWithAbbreviation", "when

In vim, why is 'j' used for down and 'k' for up?

天大地大妈咪最大 提交于 2019-12-20 10:22:11
问题 I've been using vim for many years and have never really thought about it. A friend of mine asked why that is, noting that in our culture, left would usually map to up while right would map to down, making the vim keys backwards. I understand that they are on the home row, meaning that you do not have to move your fingers anywhere to hit them, but that's a different point altogether. Basically, my question is: does anyone know why these keys were given their present purposes? It would be

Insert a newline without entering in insert mode, vim

匆匆过客 提交于 2019-12-20 09:33:26
问题 I want insert newlines in normal mode in vim using Shift-Enter and Ctrl-Enter . I try some solutions and mixing solutions from Vim Wikia - Insert newline without entering insert mode but Shift-Enter and Ctrl-Enter didn't respond: " put a new line before or after to this line nnoremap <S-CR> m`o<Esc>`` nnoremap <C-CR> m`O<Esc>`` " reverse J command nnoremap <C-J> vaW<Esc>Bi<CR><Esc>k:s/\s\+$//<CR>$ 回答1: My alternative is using oo (resp. OO ) to insert a new line under (resp. over) the current

Binding a function to a key is not working

可紊 提交于 2019-12-20 07:06:43
问题 My code: import tkinter master = tkinter.Tk() master.title("test1") master.geometry("300x300") masterFrame = tkinter.Frame(master) masterFrame.pack(fill=tkinter.X) checkboxArea = tkinter.Frame(masterFrame, height=26) checkboxArea.pack(fill=tkinter.X) inputStuff = tkinter.Frame(masterFrame) checkboxList = [] def drawCheckbox(): checkboxList.append(entry.get()) entry.delete(0,tkinter.END) checkboxRow = tkinter.Frame(checkboxArea) checkboxRow.pack(fill=tkinter.X) checkbox1 = tkinter.Checkbutton

Binding a function to a key is not working

不羁岁月 提交于 2019-12-20 07:06:25
问题 My code: import tkinter master = tkinter.Tk() master.title("test1") master.geometry("300x300") masterFrame = tkinter.Frame(master) masterFrame.pack(fill=tkinter.X) checkboxArea = tkinter.Frame(masterFrame, height=26) checkboxArea.pack(fill=tkinter.X) inputStuff = tkinter.Frame(masterFrame) checkboxList = [] def drawCheckbox(): checkboxList.append(entry.get()) entry.delete(0,tkinter.END) checkboxRow = tkinter.Frame(checkboxArea) checkboxRow.pack(fill=tkinter.X) checkbox1 = tkinter.Checkbutton

Make SHIFT+3 produce `#` not `£` on OSX by code

余生长醉 提交于 2019-12-20 05:39:16
问题 On my UK MacBook Air, # can be typed using OPT+3. SHIFT+3 currently produces £ . How can I rewire so that SHIFT+3 produces # ? This question is motivated by https://apple.stackexchange.com/questions/156154/use-option-as-meta-key-with-ability-to-type-the-symbol I think it's a failing that the default setting on OSX's Terminal app doesn't register OPT (which is needed e.g. for keyboard shortcuts in the nano editor), and that if you switch the setting to enable it, you are now unable to type # ,

C# how to disable keybinding

筅森魡賤 提交于 2019-12-20 03:57:11
问题 The MenuItem control has the convenient property IsEnabled (inherited from UIElement). This allows me to, when appropriate, hide the command exposed by that menu option. But if that command is also bound to a key (e.g. Ctrl+K), the user can still access it. How do I get the IsEnabled functionality to a KeyBinding? 回答1: If you bind the KeyBinding to an ICommand , you can just set the ICommand.CanExecute to false (and potentially raise CanExecuteChanged). This will "disable" the KeyBinding

Why doesn't setting MenuItem.InputGestureText cause the MenuItem to activate when I perform the input gesture?

寵の児 提交于 2019-12-19 18:58:12
问题 I want to implement Keyboard shortcuts for a MenuItem . I have used the code below: <MenuItem Header="_New" InputGestureText="CTRL+N" Click="NewMenu_Click"> <MenuItem.Icon> <Image Source= "Images\NEW.PNG" Width="25" Height="28" /> </MenuItem.Icon> </MenuItem>` But the InputGestureText property is not responding when I pressed the CTRL+N . I am using Visual Studio Express Edition 2010. Am I missing anything here? 回答1: It is quite explicit in the documentation for the property: This property

How does Java dispatch KeyEvents?

浪子不回头ぞ 提交于 2019-12-19 15:07:43
问题 I've read the definite tutorial on key bindings a few times, but my brain cache doesn't seem large enough to hold the complicated processes. I was debugging a key binding problem (turned out I was using the wrong JComponent.WHEN_* condition), and I stumbled upon a concise and hilarious javadoc for the package private javax.swing.KeyboardManager by an (unfortunately) anonymous Java engineer. My question is this: except for KeyEventDispatcher which is checked at the very beginning, does the

How does Java dispatch KeyEvents?

送分小仙女□ 提交于 2019-12-19 15:07:30
问题 I've read the definite tutorial on key bindings a few times, but my brain cache doesn't seem large enough to hold the complicated processes. I was debugging a key binding problem (turned out I was using the wrong JComponent.WHEN_* condition), and I stumbled upon a concise and hilarious javadoc for the package private javax.swing.KeyboardManager by an (unfortunately) anonymous Java engineer. My question is this: except for KeyEventDispatcher which is checked at the very beginning, does the