Skip to content

Commit

Permalink
Updated README and keymapper.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
houmain committed Sep 7, 2024
1 parent 6dd0b1a commit 0fc3fca
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 41 deletions.
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
69 changes: 36 additions & 33 deletions keymapper.conf
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -108,6 +107,7 @@ ScrollLock >> Boss
(Shift AltGr){Semicolon} >> 'Ö'
AltGr{Semicolon} >> 'ö'
AltGr{D} >> 'ß'
AltGr{Q} >> '@'
AltGr{Backquote} >> '°'

E >> F
Expand Down Expand Up @@ -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} >> '('
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -244,3 +246,4 @@ ScrollLock >> Boss

[title="Geany"]
go_to_definition >> (Control Shift){T}

0 comments on commit 0fc3fca

Please sign in to comment.