keyboard-shortcuts

Send a keyboard shortcut to a Mac OS X Window

梦想的初衷 提交于 2019-11-30 02:25:56
Is it possible for one window on a Mac desktop to programatically send a keyboard shortcut or key sequence to another? I'm looking to control an application which offers no API to do such, by using the application's keyboard shortcut features. I'm fairly sure this can be done on Windows, but Mac? Thanks fardjad One way to do this is embedding Applescript in your Objective-C application. For example executing this apple script, sends Command + M to System Events application: tell application "System Events" to keystroke "m" using {command down} You can embed the script above in your Cocoa

Keyboard shortcut to Un/Comment out code in Mathematica 7?

走远了吗. 提交于 2019-11-30 02:11:28
A keyboard shortcut to comment/uncomment out a piece of code is common in other programming IDE's for languages like Java, .Net. I find it a very useful technique when experimenting through trial and error to temporarily comment out and uncomment lines, words and parts of the code to find out what is and isn't working. I cannot find any such keyboard shortcut on the Mathematica front end in version 7. I know that it is possible to comment out code by selecting the code, right mouse click and select Un/Comment from the menu that appears but this is too slow while coding. I tried to access this

How to Program custom Keyboard Shortcuts

爷,独闯天下 提交于 2019-11-30 01:43:57
I have a Qt application on Linux. I'd like to program custom keyboard shortcuts such as CTRL - Q which will then call a subroutine which quits the program. How can I do this? dtech Try this: new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), this, SLOT(close())); You can create it in the contructor of your form. This allows to avoid polluting your class with a pointer to access the shortcut. You may still want to add a pointer to the shortcut if you want to access it later on. The shortcut will be deleted when the application exits, since it is parented to it. It automatically does the

How to open the lightbulb via shortcut?

孤街醉人 提交于 2019-11-30 01:39:32
Some languages support code actions which display a lightbulb providing quick fixes for a warning/error (See https://code.visualstudio.com/docs/editor/editingevolved#_code-action for more information). I like this feature but I don't like to click on the lightbulb. Unfortunately I can't find a shortcut for opening the lightbulb at the current cursor position . How can I create such a shortcut? I tried to create a shortcut for vscode.executeCodeActionProvider by creating a custom keybinding like this: [{ "key": "alt+enter", "command": "vscode.executeCodeActionProvider"}] But everytime I hit the

JavaScript keyboard shortcuts for web application [closed]

家住魔仙堡 提交于 2019-11-30 01:34:52
I want to develop a web application, which should (ideally) be fully usable via the keyboard. I know how to handle keyboard events in JavaScript, but managing them for a larger application is quite boring. Is there a library which makes that process easier? Please note that I'm not interested in a full-blown Web GUI framework. I want to keep control over my webpage/application. Check out my project: https://github.com/oscargodson/jkey And demos: http://oscargodson.github.com/jKey/ Feel free to use it and if you want, contribute :) Craig I just developed one of my own called Mousetrap . Check

Close all tabs, but not the window, in Sublime Text

浪尽此生 提交于 2019-11-30 01:08:49
Is there a way to close all tabs in one go in Sublime Text, but leave the window with the current project open? It is really annoying when I just want to close all open file and start the new task I have to Cmd-W them one by one. If I do Cmd-Opt-W it will close all tabs and the current project. Thanks to Alex, it turned out kind of simple, Preferences > Key Bindings > User: { "keys": ["super+shift+w"], "command": "close_all" } No need to restart Sublime, it works right away. And what's even better, no need to get used new shortcuts, you can still close Sublime window with Cmd-W after all tabs

Learning emacs - useful mnemonics?

这一生的挚爱 提交于 2019-11-30 00:27:26
Are there any mnemonics or patterns that make memorizing emacs key combos easier? T.E.D. Well, the main important ones are: ` C-k to " K ill" a line and C-y to " Y ank" it back from the kill buffer (aka: clipboard). C-s to " S earch " C-h for " H elp" C-t " T ranspose" two characters. C-p " P revious" line C-n " N ext" line C-f " F orward" char C-b " B ackward" char C-e " E nd" of line C-a .... a is the beginning of the alphabet, so " A beginning" of line Other than that I mostly use the arrow keys, the mouse, the menus, or a select group of actual commands. The few exceptions to this (eg:

How to unbind a key binding in Sublime Text 2?

百般思念 提交于 2019-11-30 00:20:06
I have a habit of hitting CTRL + T to open a new tab in ST2. However this invokes the transpose function. I could map the new_file command to CTRL + T , but is it possible to disable the command completely via user keymap file. My search suggested adding this to user keymap. [ { "keys": ["ctrl+t"], "command": "unbound" } ] Is the "unbound" an officially endorsed way of disabling a shortcut? I have never see or read any official documentation about the unbound command, but it works. Another option would be removing the command attribute. { "keys": ["ctrl+t"] } This will also unbound a key

Adobe AIR Keyboard Hook

…衆ロ難τιáo~ 提交于 2019-11-30 00:13:43
问题 I'm trying to add a feature to my AIR app that can listen for (configurable) global keyboard events even when the app is minimized. Ex: CTRL-ALT-SHIFT-F12 to grab a screenshot. I can't find any way to register a keyboard hook, and listening for keyboard events only captures them when the app has focus. Suggestions? 回答1: I don't think that Adobe Air programs can process keypress events unless the application is in focus. http://forums.adobe.com/thread/420446 Even this question regarding a

Why does < C-a> (CTRL+A) not work under gvim on windows?

爱⌒轻易说出口 提交于 2019-11-29 23:57:13
I'm trying to use the < C-a> ( CTRL + A ) shorcut under vim to increment a variable under the cursor. This works fine under vim running on Linux. However when I try to do this in gvim under windows it "selects all" (i.e. highlights or visually selects all text in the current window). How can I change this behaviour or alternatively how can I recover the increment variable functionality (e.g. perhaps with a different key mapping)? This is because of mswin.vim that is sourced by the default _vimrc generated when you install vim. Just override your _vimrc with the .vimrc you are using under *nix,