Keyboard Mapping Tool For Mac



By Xah Lee. Date: . Last updated: .

BetterTouchTool lets you map trackpad gestures to system actions, including custom keyboard shortcuts. Its core functionality is simple: select an app to configure (or “Global” for all apps), add a gesture, and then tell it what you want that gesture to do. Try Ukelelekeyboard layout editor and DoubleCommand. I use both, however to make some more typical changes (set Return key to be Option key with DoubleCommand, make comma instead of dot on numeric keyboard). Don't know if you can make Enter out of any key. Keyboard layouts in Parallels Desktop for Mac are inherited from Mac side. If you would like to use Windows-like layout, please follow these simple steps: Changing the keyboard layout in Windows 10. Click on Search on Windows taskbar and type in Language Settings, then press Enter/return.

Keyboard Mapping Tool For Mac

Here's a guide of keyboard shortcut and automations tools for the Mac.

I created aDvorak Keyboard Layoutusing ResEdit on Mac back in 1992, and been using QuicKeys back then, it was the best automation tool. Also many app launchers and keyboard tools over the decades that came and went.On this page, i only list the latest ones that's still available.

Swap Modifiers

Karabiner-Elements

Karabiner-Elements (was known as KeyRemap4MacBook) lets you do advanced key remapping.

Download at[Karabiner-Elements At https://karabiner-elements.pqrs.org/ ]

Karabiner is very advanced. You can:

  • Distinguish left Ctrl vs right Ctrl, remap Escape, remap Enter key.
  • Set Space bar to be Ctrl or ⌘ command when held down with another key, but as space itself when no other keys is pressed at the same time.
  • Set keys to be device dependent. i.e. You have 2 keyboard. You want F2 to do different things.

Keyboard Mapping Tool For Macbook Pro

Change Keyboard Shortcut in App

Mac OS X since 10.4 (year 2005) lets you change keyboard shortcut in a specific app.

Go to System Preferences, Keyboard and Mouse, Keyboard Shortcuts. Then click the + sign add button.

Note: This mechanism is not very flexible, because:

  • Once you create a hotkey, the original key won't work anymore. (for example, if you set F3 to Copy, then ⌘ command+c won't work.)
  • It only lets you create a key for a action that has a menu. (for example, you cannot define a key to launch a app.)
  • Numerical keypad keys cannot be used as trigger. (For example, you cannot make the number pad keys as personalized extra function keys.)

Suppose you have a gaming mouse,and you've set buttons to do copy and paste, across any computer running macOS.But you've also madeF2 as copy on your home Mac, so you can do them easily from keyboard too.Now, your mouse copy button don't work anymore, because⌘ command+cno longer works.

Programable Keyboards

Get a programable keyboard with onboard memory. This is the best solution.Because you can plug the keyboard in any computer and it'll work with your settings.

See Programable Keyboards with Onboard Memory

or, get a programable keypad.

App Launcher

App launchers are primarily designed to launch apps, open files, run scripts.You set a key to do them, or, a hotkey that pops up a dialog, then type any letter to launch or search.

Quicksilver. A app launcher. Assign hotkey to launch/switch/open apps or files. The hotkey can be single key (For example, F1) or combo-key (For example, ⌘ command+F1).

Alfred Automation Tool

Hammerspoon Automation Tool

Using lua as scripting language.

Keyboard Maestro

Text Editor Key Behavior

aka DefaultKeyBinding.dict

This is macOS's system-wide mechanism, for creating keybinding to control cursor movement or editing operations.

See: macOS: Create Custom Keyboard Layout

USB Overdrive

USB Overdrive is low-level USB tool. It lets you remap key or mouse buttons at USB level.

Excellent.

[USB Overdrive By Alessandro Levi Montalcini. At http://www.usboverdrive.com/USBOverdrive/News.html ]

View Keypress and Keycode

Install[Karabiner-Elements At https://karabiner-elements.pqrs.org/ ]

It'll also install a “Karabiner-EventViewer”. It's in your Applications folder.

Launch it, and press key or mouse button and it'll show the keycode.

ControllerMate

[ControllerMate At http://www.orderedbytes.com/controllermate/. Commercial. USB interface mapper. Seems to let you remap any USB input device's signals in flexible ways, including mouse.]

[review of ControllerMate by Jonny, 2017-02-27.]

I've been using ControllerMate for several years now and I have to saythat it is really an amazing and extremely powerful piece of software,and very flexible! The developer is also very quick to respond to questionson the forum and to come up with solutions which require coding (custompatches or add ons to download, or updates to download- depending on thesituation). There is a bit of a learning curve! And while the interfaceis logical and straightforward, getting used to the basic underlying logicbehind it all takes some time. But I can't even begin to explain all theunique and creative things you can do with it.

But I'll give a could examples... I quite easily was able to switcharound and re-program lots keys on my keyboard (KM0Z1-5N6P and was ableto physically switch the keys around as well to match), I also did somemore complicated reprogramming using the Apps/Menu key almost like a newmodifier, mainly to launch apps but also to access the higher Fn-keys (adding10 to what's printed on the keyboard — only up to F20 though which he saysis the MacOS limit).

Itool For Mac

I also customized my trackball so that if I double-middle-click-hold the ball becomes an any direction scroll “ball”.

Another major product was creating a very unique, customized programmingfor a Logitech G13. I did use the native software for just a couple offunctions- basically for setting up the backlight colors for the various“pages” and configuring the applets. One cool thing I did that I use allthe time is to setup the joystick to switch “Spaces” (Mission Control),and to move windows between my multiple monitors, and to move windows between“Spaces” depending on which of the adjacent button(s) I'm holding. It'sSUPER easy and convenient! I also use those buttons (pretty much designedto be mouse buttons) as shift-life modifiers to access deeper levels ofthe closer buttons (in addition to and unique for the 3 ‘main’ pages whichare built in). In some cases I set them up to trigger regular hotkeys,sometimes I create custom hotkeys with the keyboard control panel (typicallyusing combos involving keys that aren't even on my keyboard or that arevery difficult to type), and sometimes I have them trigger AppleScriptsthat native commands or use GUI control but only if the app is alreadyrunning.

Honestly that barely even scratches the surface of all the things Iknow that ControllerMate can do which is only a fraction of what it canreally do!

  • amazon egift card to xah@xahlee.org , $20 is nice.
  • paypal to xah@xahlee.org , $20 is nice.
  • bitcoin me 19dfoa3Q7oehm9MwCULQzBG8vqfCaeMazH

If you have a question, put $5 at patreon and message me.

Table of Contents

Introduction

Limitation: AutoHotkey's remapping feature described below is generally not as pure and effective as remapping directly via the Windows registry. For the advantages and disadvantages of each approach, see registry remapping.

Remapping the Keyboard and Mouse

The syntax for the built-in remapping feature is OriginKey::DestinationKey. For example, a script consisting only of the following line would make the A key behave like the B key:

The above example does not alter the B key itself. The B key would continue to send the 'b' keystroke unless you remap it to something else as shown in the following example:

The examples above use lowercase, which is recommended for most purposes because it also remaps the corresponding uppercase letters (that is, it will send uppercase when CapsLock is 'on' or the Shift key is held down). By contrast, specifying an uppercase letter on the right side forces uppercase. For example, the following line would produce an uppercase B when you type either 'a' or 'A' (as long as CapsLock is off):

However, a remapping opposite to the one above would not work as one might expect, as a remapping never 'releases' the modifier keys which are used to trigger it. For example, A::b is typically equivalent to A::B and ^a::b is equivalent to ^a::^b. This is because each remapping internally uses {Blind} to allow the key or key combination to be combined with other modifiers.

Mouse Remapping

Keyboard Mapping Tool For Mac Windows 10

To remap the mouse instead of the keyboard, use the same approach. For example:

MButton::ShiftMakes the middle button behave like the Shift key.
XButton1::LButtonMakes the fourth mouse button behave like the left mouse button.
RAlt::RButtonMakes the right Alt key behave like the right mouse button.

Other Useful Remappings

CapsLock::CtrlMakes CapsLock become a Ctrl key. To retain the ability to turn CapsLock on and off, add the remapping +CapsLock::CapsLock first. This toggles CapsLock on and off when you hold down the Shift key and press CapsLock. Because both remappings allow additional modifier keys to be held down, the more specific +CapsLock::CapsLock remapping must be placed first for it to work.
XButton2::^LButtonMakes the fifth mouse button (XButton2) produce a control-click.
RAlt::AppsKeyMakes the right Alt key become the Menu key (which is the key that opens the context menu).
RCtrl::RWinMakes the right Ctrl key become the right Win key.
Ctrl::AltMakes both Ctrl keys behave like an Alt key. However, see alt-tab issues.
^x::^cMakes Ctrl+X produce Ctrl+C. It also makes Ctrl+Alt+X produce Ctrl+Alt+C, etc.
RWin::ReturnDisables the right Win key by having it simply return.

You can try out any of these examples by copying them into a new text file such as 'Remap.ahk', then launching the file.

See the Key List for a complete list of key and mouse button names.

Remarks

The directives #IfWinActive/Exist can be used to make selected remappings active only in the windows you specify. For example:

Remapping a key or button is 'complete' in the following respects:

  • Holding down a modifier such as Ctrl or Shift while typing the origin key will put that modifier into effect for the destination key. For example, b::a would produce Ctrl+A if you press Ctrl+B.
  • CapsLock generally affects remapped keys in the same way as normal keys.
  • The destination key or button is held down for as long as you continue to hold down the origin key. However, some games do not support remapping; in such cases, the keyboard and mouse will behave as though not remapped.
  • Remapped keys will auto-repeat while being held down (except keys remapped to become mouse buttons).

Although a remapped key can trigger normal hotkeys, by default it cannot trigger mouse hotkeys or hook hotkeys (use ListHotkeys to discover which hotkeys are 'hook'). For example, if the remapping a::b is in effect, pressing Ctrl+Alt+A would trigger the ^!b hotkey only if ^!b is not a hook hotkey. If ^!b is a hook hotkey, you can define ^!a as a hotkey if you want Ctrl+Alt+A to perform the same action as Ctrl+Alt+B. For example:

Alternatively, in [v1.1.06] and later, #InputLevel can be used to override the default behaviour. For example:

If SendMode is used in the auto-execute section (top part of the script), it affects all remappings. However, since remapping uses Send {Blind} and since the SendPlay mode does not fully support {Blind}, some remappings might not function properly in SendPlay mode (especially Ctrl, Shift, Alt, and Win). To work around this, avoid SendPlay in auto-execute section when you have remappings; then use the command SendPlay vs. Send in other places throughout the script. Alternatively, you could translate your remappings into hotkeys (as described below) that explicitly call SendEvent vs. Send.

When a script is launched, each remapping is translated into a pair of hotkeys. For example, a script containing a::b actually contains the following two hotkeys instead:

However, the above hotkeys vary under the following circumstances:

  1. When the source key is the left Ctrl key and the destination key is an Alt key, the line Send {Blind}{LAlt DownR} is replaced by Send {Blind}{LCtrl up}{LAlt DownR}. The same is true if the source is the right Ctrl key, except that {RCtrl up} is used.
  2. When a keyboard key is being remapped to become a mouse button (e.g. RCtrl::RButton), the hotkeys above use SetMouseDelay in place of SetKeyDelay. In addition, the first hotkey above is replaced by the following, which prevents the keyboard's auto-repeat feature from generating repeated mouse clicks:
  3. When the source is a custom combination in [v1.1.27.01+], the wildcard modifier (*) is omitted to allow the hotkeys to work.

Prior to [v1.1.27], DownTemp was used instead of DownR.

Note that SetKeyDelay's second parameter (press duration) is omitted in the hotkeys above. This is because press-duration does not apply to down-only or up-only events such as {b down} and {b up}. However, it does apply to changes in the state of the Shift/Ctrl/Alt/Win keys, which affects remappings such as a::B or a::^b. Consequently, any press-duration a script puts into effect via its auto-execute section will apply to all such remappings.

Keyboard Mapping App Mac

Since remappings are translated into hotkeys as described above, the Suspend command affects them. Similarly, the Hotkey command can disable or modify a remapping. For example, the following two commands would disable the remapping a::b.

Alt-tab issues: If you remap a key or mouse button to become an Alt key, that key will probably not be able to alt-tab properly. A possible work-around is to add the hotkey *Tab::Send {Blind}{Tab} -- but be aware that it will likely interfere with using the real Alt key to alt-tab. Therefore, it should be used only when you alt-tab solely by means of remapped keys and/or alt-tab hotkeys.

In addition to the keys and mouse buttons on the Key List page, the source key may also be a virtual key (VKnn) or scan code (SCnnn) as described on the special keys page. The same is true for the destination key except that it may optionally specify a scan code after the virtual key. For example, sc01e::vk42sc030 is equivalent to a::b on most keyboard layouts.

To disable a key rather than remapping it, make it a hotkey that simply returns. For example, F1::return would disable the F1 key.

The following keys are not supported by the built-in remapping method:

  • The mouse wheel (WheelUp/Down/Left/Right).
  • Pause and Break as destination key names (since they match the names of commands). [v1.1.32+]:vk13 or the corresponding scan code can be used instead.
  • Curly braces {} as destination keys. Instead use the VK/SC method; e.g. x::+sc01A and y::+sc01B.
  • A percent sign (%) as a destination key. Instead use the VK/SC method.
  • 'Return' as a destination key. Instead use 'Enter'.

Keyboard Mapping Tool For Mac Shortcut

Moving the Mouse Cursor via the Keyboard

Keyboard Mapping Tool For Mac Osx

Keyboard Mapping Tool For Mac

The keyboard can be used to move the mouse cursor as demonstrated by the fully-featured Keyboard-To-Mouse script. Since that script offers smooth cursor movement, acceleration, and other features, it is the recommended approach if you plan to do a lot of mousing with the keyboard. By contrast, the following example is a simpler demonstration:

Remapping via the Registry's 'Scancode Map'

Advantages:

  • Registry remapping is generally more pure and effective than AutoHotkey's remapping. For example, it works in a broader variety of games, it has no known alt-tab issues, and it is capable of firing AutoHotkey's hook hotkeys (whereas AutoHotkey's remapping requires a workaround).
  • If you choose to make the registry entries manually (explained below), absolutely no external software is needed to remap your keyboard. Even if you use KeyTweak to make the registry entries for you, KeyTweak does not need to stay running all the time (unlike AutoHotkey).

Disadvantages:

Keyboard Mapping Tool Mac

  • Registry remapping is relatively permanent: a reboot is required to undo the changes or put new ones into effect.
  • Its effect is global: it cannot create remappings specific to a particular user, application, or locale.
  • It cannot send keystrokes that are modified by Shift, Ctrl, Alt, or AltGr. For example, it cannot remap a lowercase character to an uppercase one.
  • It supports only the keyboard (AutoHotkey has mouse remapping and some limited joystick remapping).

How to Apply Changes to the Registry: There are at least two methods to remap keys via the registry:

  1. Use a program like KeyTweak (freeware) to visually remap your keys. It will change the registry for you.
  2. Remap keys manually by creating a .reg file (plain text) and loading it into the registry. This is demonstrated at www.autohotkey.com/forum/post-56216.html#56216

Related Topics

List of keys and mouse buttons
GetKeyState
Remapping a joystick