keyboard-shortcuts

How to assign Ctrl+, (control plus comma) as the keyboard shortcut to a WPF menu item?

半腔热情 提交于 2019-12-11 02:23:21
问题 Question I would like to assign the keyboard shortcut Ctrl + , (control plus comma) to the "Preferences..." menu item. How do I do that? There is a Key.OemComma in the Key enumeration. I have used Key.OemComma as shown in the code sample below. That works fine functionality-wise. But GUI-wise: the menu item is displayed as Preferences (Ctrl+OemComma) instead of Preferences (Ctrl+,) Sample Code InputGestureCollection keyInputs = new InputGestureCollection(); keyInputs.Add(new KeyGesture(Key

How do I run some simple C# code for a given keypress?

廉价感情. 提交于 2019-12-11 01:07:41
问题 I have a button on a XAML form that calls the btnName_Click() code in the backing cs file. I also want to assign a keyboard shortcut to run that same code. Basically CTRL + ← or something similar. This needs to work regardless of the control I'm currently in (there's a TextBox for example that I want to ensure doesn't capture the event if I'm in there). I've read up on routed commands but that seems like a lot of work for something which should be simple. Is there an easy way to do this or do

Visual studio 2015 keystroke with mouse button

半腔热情 提交于 2019-12-11 00:56:21
问题 I've just installed the Setpoint logitech software on a new PC with windows server 2012. I've assigned to one of the buttons of my mouse the keystroke Ctrl + Tab , which supposed to switch between open files on visual studio but it is not working! If i press on the button on chrome, it switch tabs, but on VS it does nothing... If I press Ctrl + Tab myself in VS the file will be switched... I've used this keystrokes many times in diffrent PC's with diffrent enviroment on visual studio 2013 and

How to trigger the listen button on the Google-translate page using javascript?

天涯浪子 提交于 2019-12-11 00:19:01
问题 I want to add shortcuts to the Google-translate page. Press Alt c or Esc to clear the textarea ; press Alt j to pronounce. This is the current user script: userscripts.org/scripts/review/110928 I do not know how to trigger the listen button on that page. I tried: var evt = document.createEvent("MouseEvents"); evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); var cb = document.getElementById("gt-src-listen"); cb.dispatchEvent(evt); but it does

Eclipse CDT automatically replace “.” with “->”

眉间皱痕 提交于 2019-12-10 23:44:11
问题 The Qt Creator have a neat feature I really like. When I'm typing obj.method , it would automatically replace the period ( . ) with an arrow ( -> ), if obj is a pointer. Makes sense actually. You never want to type pointer.something , it wouldn't be legal. Is there a way to achieve a similar function with Eclipse CDT? 来源: https://stackoverflow.com/questions/3630711/eclipse-cdt-automatically-replace-with

How can I tweak this elisp function to distinguish between C-d & DEL?

人盡茶涼 提交于 2019-12-10 23:18:03
问题 Here's my current function (blindly copy-pasted from a website) (defun tweakemacs-delete-one-line () "Delete current line." (interactive) (beginning-of-line) (kill-line) (kill-line)) (global-set-key (kbd "C-d") 'tweakemacs-delete-one-line) There are two quirks here that I want to get rid of. 1) This actually rebinds DEL to the same function. I want my DEL to remain "delete one character". 2) There needs to be a condition where it will not double-kill if the line is only a newline character.

Disable timeout on esc key

感情迁移 提交于 2019-12-10 23:14:57
问题 Problem I am in insert mode , and then I might type a number, and then quickly ESC , because I stopped typing so it will change to visual mode . What happens then, is that the cursor jumps, and not only that, the number on the line that I was (and I just typed) is decremented. This thing is a nightmare! What is causing this? Is this some kind of default behavior? If so, how can I disable it? Could this be a plugin causing it? Because I didn't always had this "feature". I was trying for some

Avoiding alert on key board shortcut of C# winform

给你一囗甜甜゛ 提交于 2019-12-10 22:28:06
问题 I am making key board shortcuts to a Winform application in C# using Visual Studio 2012. My shortcuts work perfect. But it gives a annoying beep sound. I added e.Handled = true; and e.SuppressKeyPress = true; according to many threads. But it does not work and my winform stuck. How can I avoid this? private void textBoxSearch_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Down) { do stuff } else if (e.KeyCode == Keys.Enter) { //do stuff } e.Handled = true; e.SuppressKeyPress =

VSCode Remap keyboard shortcut

让人想犯罪 __ 提交于 2019-12-10 22:22:53
问题 I have been trying for awhile now to remap the Ctrl + Tab and Ctrl + Shift + Tab keys to switch editor tabs linearly. (Like they would in Chrome) I have learned that by default, the Ctrl + PgUp and Ctrl + PgDown keys have the functionality I desire. However, whether it be through the graphical Keyboard Shortcut page or the keybindings.json file, I cannot get the keys to do what I want them to. Relevant parts of keybindings.json : { "key": "ctrl+pagedown", "command": "-selectNextPageSuggestion

Assigned shortcut to Android Studio doesn't work

放肆的年华 提交于 2019-12-10 22:03:03
问题 I wanted to close active tab by shortcut in Android studio. I found CTRL + F4 does the job from here. Although it closed active tab, keyboard functionality disabled in a way that I couldn't type anything in editor (modify my classes). So, I decided to change its shortcut. I assigned CTRL + W to close active tab and CTRL + SHIFT + W to reopen closed tab as you see in following screenshot. CTRL + SHIFT + W does its job properly while when I press CTRL + W nothing happens (active tab doesn't