hotkeys

What are cross-browser and cross-OS safe keyboard shortcuts usable for web application?

不羁岁月 提交于 2019-12-02 20:02:38
I am developing a quite large web application, and it is probably a good idea to use hotkeys for some common tasks. However, I discovered that finding safe key combinations is a problem, regarding all different browsers and OSes. For example, Chrome has such a long list of hotkeys that trying to use some kind of logical hotkeys scheme for my web application is impossible - e.g. Ctrl + 1 , Ctrl + 2 , Ctrl + 3 , etc. Do you have some cheat sheet of safe hotkeys which can be used in a web application and not worry about some browser or OS interference? BernzSed I wouldn't count on it. It's

Implement a global hotkey in golang?

别来无恙 提交于 2019-12-02 19:15:15
Let's say someone wants to create a cross-platform (Mac, Linux, Windows) global hotkey in Go (golang) - you press a hotkey combination anywhere in OS and let's say something is printed in terminal. Currently, (July 2016) I haven't found any library to do that, so maybe we can find a way together. It would involve, of course, calls to some native OS bindings for each OS, but there is very sparse information on how to do it. Mac Judging from Googling one should use addGlobalMonitorForEventsMatchingMask EDIT: useless example removed Linux Looks like the suspect is XGrabKey , though, no example

How to intercept a hot key in Cocoa when the application window is not active

南楼画角 提交于 2019-12-02 17:47:33
I am trying to create a utility that doesn't open a window when executed, and that would be activated from a hot key; I read that currently Cocoa doesn't have a function for that, and that I should use a deprecated Carbon function. Isn't there really a way to use global hot keys in Cocoa? What should I do: wait for Cocoa to introduce a function for that, or use the carbon function until a similar function is not introduced in Cocoa? Use the Carbon Event Manager's RegisterEventHotKey function . This function is supported in 64-bit (notice that it lacks the “not available in 64-bit” availability

Is there a command in Xcode 4.2 to swap two views in Assistant Editor mode from left to right and vice versa?

 ̄綄美尐妖づ 提交于 2019-12-02 17:01:30
I would like to quickly swap two views from one side to the other and wonder if there is a hotkey for this functionality? Single Assistant Editor This can be done in two steps. You can start with the cursor in either the Primary or the Assistant editor. Step 1: ⌥ ⌘ , - Open in Assistant / Primary Editor It opens the current file (where the cursor is) in Primary Editor if you are in Assistant Editor and vice versa. You end up with two exact same files open. Step 2: ^ ` - Move Focus to Next Editor (available since Xcode 8, in older version use ⌘ J ) ^ ⌥ ⌘ ← - Go Back (and open the result) in

Hotkey to end the line with a semicolon and jump to a new line in Sublime Text 2

社会主义新天地 提交于 2019-12-02 15:48:45
I'm trying to figure out a hotkey at work. I just got this job and I am using a Mac for more or less the first time in my life. Back home on my Laptop, when using Eclipse, I seem to remember there being a single hotkey which would both: Add a ; to the end of my current line (no matter where the caret was within said line) Place my cursor at the beginning of a new line , with the same indentation level as the line I had just added a semicolon to Does anybody know if this was an Eclipse-specific hotkey, or know of a way to replicate said hotkey in Sublime Text 2? Best solution for this is

Setting a hotkey in a Java program that exits, without a GUI

不问归期 提交于 2019-12-02 09:15:48
I'm writing a program that will run continuously and I was wondering if there was a Java equivalent to the Autoit SetHotKey(Key, Action()). I saw an answer on here that related to a GUI interface, but my program does not have a GUI. I just want the program to exit whenever I press a certain key, preferably ESC. I'd have the program running in an infinite loop using the awt.Robot's keyevents, I'd like to be able to quit the program by pressing a certain key. There are no core Java solutions since Java was built to be as operating system agnostic as possible, and to achieve your goal, you need a

Catch a “double” hotkey

依然范特西╮ 提交于 2019-12-02 05:06:18
问题 I have to catch a hotkey of Ctrl+Alt+C, C (meaning, press Ctrl+Alt+C , release only C and press it again). Here is what I'm trying to do: import com.tulskiy.keymaster.common._ import java.awt.event._ import javax.swing.KeyStroke class KeysCatcher { val provider = Provider.getCurrentProvider(true) val ctrlC = KeyStroke.getKeyStroke(KeyEvent.VK_C, ActionEvent.CTRL_MASK + ActionEvent.ALT_MASK) val listener = new HotKeyListener() { def onHotKey(hotKey: HotKey): Unit = { hotKey.keyStroke match {

Catch a “double” hotkey

女生的网名这么多〃 提交于 2019-12-02 03:35:00
I have to catch a hotkey of Ctrl+Alt+C, C (meaning, press Ctrl+Alt+C , release only C and press it again). Here is what I'm trying to do: import com.tulskiy.keymaster.common._ import java.awt.event._ import javax.swing.KeyStroke class KeysCatcher { val provider = Provider.getCurrentProvider(true) val ctrlC = KeyStroke.getKeyStroke(KeyEvent.VK_C, ActionEvent.CTRL_MASK + ActionEvent.ALT_MASK) val listener = new HotKeyListener() { def onHotKey(hotKey: HotKey): Unit = { hotKey.keyStroke match { case `ctrlC` => println("Ctrl+Alt+C 1 was pressed") val listener2 = new HotKeyListener() { def onHotKey

Listening for global key-combinations in python on Linux

馋奶兔 提交于 2019-12-01 21:28:48
问题 I just wrote a little program which downloads a new wallpaper from flickr every few minutes. Now I want to add the capability to "like" a wallpaper, so it will occur more often than non-liked or disliked wallpapers. I'd like to assign a global keyboard-shortcut to this function. For example: If I press ctrl+7, it would execute some kind of "like" function in Python. Are there any libraries for this (in JavaScript for example there's a library where I can define shortcuts with shortcut("ctrl-b

Emacs Ctrl modifiers don't work in console

*爱你&永不变心* 提交于 2019-12-01 20:21:30
问题 I have 2 hotkeys for dired, that work in GUI mode in Emacs: (add-hook 'dired-mode-hook (lambda () (define-key dired-mode-map (kbd "C-<up>") (lambda () (interactive) (find-alternate-file ".."))))) (add-hook 'dired-mode-hook (lambda () (define-key dired-mode-map (kbd "C-<right>") 'diredp-find-file-reuse-dir-buffer))) But when I click CTRL + → or CTRL + ↑ in console the cursor just moves as if the arrow was pressed. When I try CTRL + H K and then CTRL + → , it gives me the right key docs as if