keyboard-shortcuts

JavaFX strange menu accelerator behaviour

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-01 19:24:48
问题 I noticed a really strange behaviour with menu accelerators on the JavaFX (system) menu. Some key combinations don't work at all and others are interpreted as the wrong key. For instance, when you use the CMD+CLEAR key as accelerator, it gets changed as the CMD+Page Down down key (both in the menu text and in the actual response to a keyboard event). The '-' (MINUS) key doesn't work well at all and while, CMD + - shows up well in the menu, it never gets triggered when you press the keys. When

How to monitor for keystrokes pressed when outside the App?

纵饮孤独 提交于 2020-01-01 17:48:45
问题 I need a way in C# to monitor system-wide keys such as Ctrl + A , so I can act upon that. How could I get such an event, even when the keys were pressed with my App no longer in focus? 回答1: You can use the RegisterHotKey function to react system-wide to hotkeys. However, I wouldn't advise you to use something like Ctrl + A which has a meaning in many applications. 回答2: I don't think there's a managed way to do that. At an API level you can register system-wide hooks or global hotkeys. Writing

Single ESC closes ALL modal dialogs in jQuery UI. Workarounds?

五迷三道 提交于 2020-01-01 11:48:29
问题 Actually, there was (is still) a bug in jQuery: http://bugs.jqueryui.com/ticket/4511. The reason for this behavior (from the bug description comments): "The dialog itself binds keydown event to itself for closing the dialog on ESC ; in addition, the dialog overlay binds a keydown event to the document, without filtering to close only the active dialog." I cannot come up with an idea of an acceptable workaround. Is there anyone who has had to deal with it yet? 回答1: Very simple - upon creating

Is there a good Vi(m) command for transposing arguments in a function call? Bonus points for Emacs

柔情痞子 提交于 2020-01-01 04:28:06
问题 For example if I have some code like: foo = bar("abc", "def", true, callback); Is there a nice command to move true to the 1st or 2nd position leaving the commas intact? P.S as a bonus my friend want to know if this works in Emacs too. 回答1: In Vim if you place the cursor at the start of the first word and do dWWP then it will have the desired effect. Here is a breakdown: dW delete the current word, including the comma and the following whitespace W move to the start of the next word P insert

Dvorak typers, how do you handle shortcuts like Ctrl-C?

天大地大妈咪最大 提交于 2020-01-01 04:07:53
问题 Do you change the key binding in the OS to be, i.e., Ctrl-Q? Do you manage to stretch your left hand to the C key? Do you use right ctrl and press shortcuts with your right hand? 回答1: When I switched to Dvorak, I was using primarily Ctrl + Ins and Shift + Ins for copy/paste. Now I use Ctrl + C and Ctrl + V and other program-specific shortcuts, but I have just learned to use them in their "weird" locations. A similar question was asked on SuperUser, with the following answers: Use an

Eclipse's Visual Studio Ctrl+Tab and Ctrl+Shift+Tab Equivalent

若如初见. 提交于 2020-01-01 03:56:05
问题 In Visual Studio, I always use Ctrl + Tab and Ctrl + Shift + Tab to navigate between documents. I see that Eclipse has Ctrl + F6 to navigate between editors, but this isn't nearly the same behavior. The difference being, pressing it once and then again will get you moving back and forth between two files, whereas in VS, it will cause you to navigate forward based on the tab order in the editor. Any ideas on how I can replicate VS's behavior? 回答1: Looking at Keys in the preferences dialog,

Shortcut key for 'View in Object Browser'

风格不统一 提交于 2020-01-01 01:56:10
问题 Does anyone know if there is a shortcut key for viewing the selected object (in the text editor) in the object browser? I am sure there was one, but I cannot find it, or anything that seems to work in the key bindings dialog. eg: string test = string.empty; if (string.isnullorempty(test)) { ^ caret here ... } pressing the key would open the object browser to System.String 回答1: F12 will go to the source (if you have it), or the object browser if it's in a referenced assembly. 回答2: This

macOS App: handling key combinations bound to global keyboard shortcuts

眉间皱痕 提交于 2019-12-31 23:41:12
问题 In some apps, it makes sense for the app to directly handle keyboard shortcuts which are otherwise bound to system wide combinations. For example, ⌘-Space (normally Spotlight) or ⌘-Tab (normally app switcher). This works in various Mac apps, such as VMWare Fusion, Apple's own Screen Sharing and Remote Desktop clients (forwarding the events to the VM or server, respectively, instead of handling them locally), and also some similar third-party apps in the App Store. We would like to implement

Tkinter dropdown Menu with keyboard shortcuts?

∥☆過路亽.° 提交于 2019-12-31 12:13:55
问题 I would like to have a Dropdown Menu in Tkinter, that includes the shortcut key associated with this command. Is this possible? How would I also add the underline under a certain character, to allow for Alt-F-S (File->Save)? 回答1: import tkinter as tk import sys class App(tk.Tk): def __init__(self): tk.Tk.__init__(self) menubar = tk.Menu(self) fileMenu = tk.Menu(menubar, tearoff=False) menubar.add_cascade(label="File", underline=0, menu=fileMenu) fileMenu.add_command(label="Exit", underline=1,

android studio / intellij idea goto line number

岁酱吖の 提交于 2019-12-31 11:39:32
问题 In Eclipse, if I type cmd+L, it opens a dialog for me to enter a line number and it takes me there in the code. How do I do the same thing in Android Studio? Instead of having to scroll each time I need a specific line number. 回答1: The shortcut to go to a specific line and/or column number is: CTRL G Examples: Go to line 6 Ctrl G 6 Enter Go to line 6 and column 8 Ctrl G 6 : 8 Enter Go to column 4 on the current line Ctrl G : 4 Enter Shortcut References: Alt H K = H̲elp -> Default K̲eymap