How do I prevent the option key from performing alternative input when I use it as part of a keyboard shortcut - macos

Usually, the keyboard shortcut will work but I will also get an accent or symbol character in the file editor.
Sometimes, even the keyboard shortcut doesn't seem to work.
I'm new to macos, so maybe this is an os-wide setting somewhere. However, there are some times when I might need a symbol or accent so I'm perplexed why the option key was chosen as a shortcut key modifier for vscode if its default behavior in a mac is to produce alternative input.

The option key alone (and with SHIFT) is generally reserved for use by the active keyboard configuration, and is not often used for application shortcuts. You generally want to have at least COMMAND or CONTROL as part of your shortcut.

Related

How to remap "copy" shortcut in Xcode

I am trying to tune the key bindings in Xcode (version 8)'s preference.
Most of the keybindings can be remapped without a problem, except the Copy(Edit Menu) command.
When I am trying to map the copy command to Option+W key combination, Xcode does not allow it and show warning:
Modifiers are reserved for alternates.
Is there a way to bypass this restriction? For example, are there any copy commands other than Copy(Edit Menu) that functions similarly? Or are there any hotkey script either at MacOS level or Xcode plugin level that can remap a keybinding to another?
(I am trying to map the copy command to Option-W because I have got quite used to this key from Emacs. )
Thank you.
On Mac OS, Option-W is a typable character. It cannot be a hotkey. Hotkeys must include Command or Control.

emacs control D key binding overridden

Any solutions out there for dealing with google script code-editor turning "forward delete" into a "kill line" binding? I'm used to the hidden cocoa/emacs derived navigation keys. Google decided to mess with control-d.
Clarifications:
This occurs when using the code editor. (edit-view?)
I would rather stop the google behavior than cope with it.
To understand more how fluid the control-key navigation can be
(and therefore how annoying when missing), try this...
set caps-lock to be the control key
open a cocoa browser like Safari and
start a script at https://script.google.com/
switch briefly to address bar
hit ctrl+a (goes to start of line)
hit ctrl+d (characters get deleted 1 at a time)
hit escape
switch to script area and try same thing (whole lines get munched!)
If you mean while you're working on your program in that editor, press the forward-delete key. On Apple's laptops and wireless keyboard, it's fn-delete (where by “delete”, I mean the backward delete, the key that is a.k.a. “backspace”).
You could try KeyRemap4Macbook.
Today I noticed that this problem no longer exists. So when editing a script file in the macro editor, emacs shortcuts WORK as expected. I cannot tell if they simply removed a bug or override, or actually patched it to work.

How can I modify the control/option/command key mappings in the IntelliJ's Emacs keymap?

GNU Emacs on Mac OS X, by default, uses the control key as CTRL, and the command key as META. This drives me crazy, because my MacBook Pro contains only a single control key on the left, while I'm used to having a control key on both sides of the keyboard.
With my GNU Emacs installation, I was able to modify the variables mac-control-modifier, mac-command-modifier, and mac-option-modifier so that command acts as CTRL and option acts as META.
How can I accomplish the same thing in IntelliJ IDEA? It's easy to select "Emacs" as the keymap, but I don't see any way make a similar remapping of CTRL and META. I know I could remap these keys globally in the OS, but I don't want to do that. I also know I could go in to each and every action and individually modify them, but that seems like a poor solution.
It's may be not the easiest solution but you can open the resources.jar (/Applications/IntelliJIdea.app/lib/resources.jar on MacOS) file, locate the Keymap_Emacs.xml (in idea directory) copy and modify it.
And then you can create a new keymap in IntelliJ for updating it with the new content (~/Library/Preferences/IntelliJIdea90/keymaps on MacOS).
That way you can change all your keymap without changing each action individually.

Using the ALT key on Komodo for Mac OS X

I am using the Emacs keybinding on Komodo IDE where Komodo uses the command key for "Meta" by default. So you press Command-X when you normally press Alt+X for Emacs on Linux.
I want to use the actual Alt key .. so when I tried to assign Alt+K, Komodo informs that "This key combination is not available" (see screenshot below)
Komodo Preferences Dialog screenshot http://dl.getdropbox.com/u/87045/permalinks/komodo-alt-key.png
How do I use the Alt key in Komodo? Is it possible?
On the Mac the Option/Alt key is used to quickly enter non-ASCII characters.
Komodo provides a few bindings involving control keys, like Alt+Return to
edit a file's properties, but it stays away from the Alt/Option key for
the most part.
I tried binding [Go to file...] to Cmd+Alt+K. The preferences dialog
accepted it (although it said it was first bound to Cmd+¬, and later said
it was bound to Cmd+Alt+Û, both of which gave me the feeling that
the binding would fail to work. There have been Mozilla bugs dealing
with inconsistencies in keybindings on OS X, and we're seeing that here.
Komodo will also let you create keybindings using combinations of
the Command, Control, and Shift keys -- I would stick with those,
and leave the Alt key for entering non-ASCII characters.
One can workaround this behavior using ControllerMate or a similar tool:
Create a new Driver Configuration for your normal keyboard
In that configuration, swap the Option and Command keys
Disable this new configuration
Create a new ControllerMate page
Add an Application Block to that page which only triggers when Komodo IDE is running in the foreground
Add a Properties Block connected to the Application Block which enables your Driver
Configuration.
Thus, when Komodo IDE is running in the foreground, ControllerMate swaps
Command and Option, giving you the Meta behavior you get everywhere else in OS X.

Safe keyboard shortcut for activating code completion style functionality in Mac OS X browsers

I'm building some code completion style text expansion functionality for text areas and inputs in a web application. I'm trying to work out a safe keyboard shortcut for invoking the completion proposals for browsers running on Mac OS X.
I've eliminated some potential candidates:
Command + Space - activates the Spotlight search field
Control + Space - activates the context menu in Firefox
Esc - cancels any background XMLHttpRequests in Firefox
That leaves Option + Space. I'm aware that may conflict with tools like Ubiquity, but that's something we don't expect our audience to be using.
Are there any conflicts I may have missed with Option+Space? Or do you have a better idea for a keyboard shortcut, and why?
A lot of Mac OS X apps use Option + Esc to do code completion or code hints.
Some kind of tab shortcut sounds like the best and most intuitive approach - users should be used to the 'type-tab-type-tab' workflow - maybe combine it with a modifier if it only wants to be optional.
As I recall, Visual Studio and TextMate both use tab to code-complete. In Visual Studio an intellisense menu pops up as you start typing and tab acts as the selection confirmation.
In TextMate, you start typing part of a command then hit tab to activate said command's associated "bundle". The associated bundle typically generates a code snippet and fills in any dynamic parts of the snippet as you type.
Come to think of it, most command lines work this way as well, auto-completing file names and paths when tab is pressed after typing a few characters.
EDIT: You say tabs are needed for field switching in a web interface, but you may want to try intercepting the keyboard event in the textfield, and check if they're started typing a macro. If they have, auto-complete and swallow the key by returning false; if not, simply let the command bubble through.
I discussed these ideas with our design team. One of them suggested using Control + Enter, which is what we decided to go with. This causes forms that only contain a single input field to automatically submit in Firefox, but we deal with that by preventing the default action caused by the event.
I re-assigned the Spotlight command to Command + Shift + Space. This is easily done via Prefrences.App

Resources