diff --git a/README.md b/README.md index 4ad26b39..06719508 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ The command line argument `-u` causes the configuration to be automatically relo The keys are named after their scan codes and are not affected by the present keyboard layout. The names have been chosen to match on what the [web browsers](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) have agreed upon, so this [handy website](http://keycode.info/) can be used to get a key's name. -For convenience the letter and digits keys are also named `A` to `Z` and `0` to `9`. The logical keys `Shift`, `Control` and `Meta` are also defined (each matches the left and right modifier keys). There are also [virtual keys](#virtual-keys) for state switching, an [Any key](#any-key) and a [No key](#no-key). +For convenience the letter and digits keys are also named `A` to `Z` and `0` to `9`. The logical keys `Shift`, `Control`, `Alt` and `Meta` are also defined (each matches the left and right modifier keys). There are also [virtual keys](#virtual-keys) for state switching, an [Any key](#any-key) and a [No key](#no-key). The mouse buttons are named `ButtonLeft`, `ButtonRight`, `ButtonMiddle`, `ButtonBack` and `ButtonForward`, the wheel is named `WheelUp`, `WheelDown`, `WheelLeft` and `WheelRight`. @@ -102,12 +102,10 @@ Meta{X} >> B Meta >> A ``` -:warning: You may want to start your configuration with mappings, which ensure that the common mouse-modifiers are never held back: +:warning: You may want to add a `@forward-modifiers` [directive](#directives) to your configuration, which ensures that the common mouse-modifiers are never held back: -```bash -Shift >> Shift -Control >> Control -AltLeft >> AltLeft +```python +@forward-modifiers Shift Control Alt ``` For a detailed description of how the mapping is applied, see the [Functional principle](#functional-principle) section. @@ -340,13 +338,13 @@ The following directives, which are lines starting with an `@`, can be inserted - `forward-modifiers` allows to set a list of keys which should never be [held back](#order-of-mappings). e.g.: ```python - @forward-modifiers Shift Control AltLeft + @forward-modifiers Shift Control Alt ``` It effectively forwards these keys in each [stage](#multiple-stages) immediately, like: ```bash Shift >> Shift Control >> Control - AltLeft >> AltLeft + Alt >> Alt ``` and automatically suppresses the forwarded keys in the output: ```bash diff --git a/keymapper.conf b/keymapper.conf index 09ed5cc8..200a9888 100644 --- a/keymapper.conf +++ b/keymapper.conf @@ -1,13 +1,12 @@ # define some aliases -Alt = AltLeft -AltGr = AltRight -Win = Meta +Alt = AltLeft +AltGr = AltRight +Win = Meta +Command = Meta # immediately forward common modifier keys (also used as mouse modifiers) -Shift >> Shift -Control >> Control -Alt >> Alt +@forward-modifiers Shift Control Alt # define a virtual "boss" key, which can be toggled using the scroll-lock key # when the boss key is "pressed", the keyboard should be intuitively useable @@ -27,10 +26,10 @@ ScrollLock >> Boss Ext >> # map Ext-S/D/F to Alt/Shift/Control - Ext{S} >> AltLeft + Ext{S} >> Alt Ext{D} >> Shift Ext{F} >> Control - Ext{A} >> AltLeft # also map A because of S/D rollover + Ext{A} >> Alt # also map A because of S/D rollover # Ext-W and the navigation keys should step in/out/over during debugging Ext{W{L}} >> debug_step_into @@ -59,7 +58,7 @@ ScrollLock >> Boss Ext{E} >> Control{F} Ext{Z} >> edit_undo (Ext Shift){Z} >> edit_redo - Ext{Z} >> Control{Y} + Ext{F} >> find Ext{Comma} >> navigate_back Ext{Period} >> navigate_fore @@ -108,6 +107,7 @@ ScrollLock >> Boss (Shift AltGr){Semicolon} >> 'Ö' AltGr{Semicolon} >> 'ö' AltGr{D} >> 'ß' + AltGr{Q} >> '@' AltGr{Backquote} >> '°' E >> F @@ -138,11 +138,11 @@ ScrollLock >> Boss BracketLeft >> '[' Shift{BracketRight} >> '}' BracketRight >> ']' - Shift{Backquote} >> '`' + Shift{Backquote} >> Shift{Equal} Space # dead key '`' Backquote >> '~' Shift{2} >> '@' Shift{3} >> '#' - Shift{6} >> '^' + Shift{6} >> Backquote Space # dead key '^' Shift{7} >> '&' Shift{8} >> '*' Shift{9} >> '(' @@ -161,20 +161,21 @@ ScrollLock >> Boss suspend_machine >> Any poweroff_machine >> Any reboot_machine >> Any - close_window >> !Win Alt{F4} + close_window >> Alt{F4} navigate_escape >> Escape - cursor_home >> !Control Home - cursor_end >> !Control End + cursor_home >> Home + cursor_end >> End open_file >> Control{O} navigate_back >> Alt{ArrowLeft} navigate_fore >> Alt{ArrowRight} - next_tab >> !Win Control{PageUp} - prev_tab >> !Win Control{PageDown} + next_tab >> Control{PageUp} + prev_tab >> Control{PageDown} edit_copy >> Control{C} edit_cut >> Control{X} edit_paste >> Control{V} edit_undo >> Control{Y} - edit_redo >> !Shift Control{Z} + edit_redo >> Control{Z} + find >> Control{F} build >> Control{B} debug_step_over >> F10 debug_step_into >> F11 @@ -183,33 +184,34 @@ ScrollLock >> Boss # system/application specific mappings for abstract commands [system="MacOS"] - close_window >> Meta{Q} - cursor_home >> !Control Meta{ArrowLeft} - cursor_end >> !Control Meta{ArrowRight} - edit_cut >> Meta{X} - edit_copy >> Meta{C} - edit_paste >> Meta{V} - edit_undo >> Meta{Y} - edit_redo >> (Meta Shift){Y} + close_window >> Command{Q} + cursor_home >> Command{ArrowLeft} + cursor_end >> Command{ArrowRight} + edit_cut >> Command{X} + edit_copy >> Command{C} + edit_paste >> Command{V} + edit_undo >> Command{Y} + edit_redo >> (Command Shift){Y} + find >> Command{F} [system="Linux"] - lower_window >> !Win (Alt Shift){PageDown} + lower_window >> (Alt Shift){PageDown} [system="Linux" class="Thunar"] cursor_home >> Backspace cursor_end >> Enter - open_terminal >> !Win (Shift Control){C} + open_terminal >> (Shift Control){C} [system="Linux" class="tilix"] - close_window >> !Win (Shift Control){W} + close_window >> (Shift Control){W} edit_paste >> (Shift Control){V} - open_terminal >> !Win ContextMenu ^ Enter + open_terminal >> ContextMenu ^ Enter [system="Windows"] - suspend_machine >> !Control !Alt Win{X} 300ms U S - poweroff_machine >> !Control !Alt Win{X} 300ms U U - reboot_machine >> !Control !Alt Win{X} 300ms U R - lower_window >> !Win Alt{Escape} + suspend_machine >> Win{X} 300ms U S + poweroff_machine >> Win{X} 300ms U U + reboot_machine >> Win{X} 300ms U R + lower_window >> Alt{Escape} open_terminal >> $(start cmd) [system="Windows" class="CabinetWClass"] # Windows Explorer @@ -244,3 +246,4 @@ ScrollLock >> Boss [title="Geany"] go_to_definition >> (Control Shift){T} +