Skip to content

Commit 0fc3fca

Browse files
committed
Updated README and keymapper.conf
1 parent 6dd0b1a commit 0fc3fca

File tree

2 files changed

+42
-41
lines changed

2 files changed

+42
-41
lines changed

README.md

+6-8
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ The command line argument `-u` causes the configuration to be automatically relo
5353

5454
The keys are named after their scan codes and are not affected by the present keyboard layout.
5555
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.
56-
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).
56+
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).
5757

5858
The mouse buttons are named `ButtonLeft`, `ButtonRight`, `ButtonMiddle`, `ButtonBack` and `ButtonForward`, the wheel is named `WheelUp`, `WheelDown`, `WheelLeft` and `WheelRight`.
5959

@@ -102,12 +102,10 @@ Meta{X} >> B
102102
Meta >> A
103103
```
104104

105-
:warning: You may want to start your configuration with mappings, which ensure that the common mouse-modifiers are never held back:
105+
: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:
106106

107-
```bash
108-
Shift >> Shift
109-
Control >> Control
110-
AltLeft >> AltLeft
107+
```python
108+
@forward-modifiers Shift Control Alt
111109
```
112110

113111
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
340338
341339
- `forward-modifiers` allows to set a list of keys which should never be [held back](#order-of-mappings). e.g.:
342340
```python
343-
@forward-modifiers Shift Control AltLeft
341+
@forward-modifiers Shift Control Alt
344342
```
345343
It effectively forwards these keys in each [stage](#multiple-stages) immediately, like:
346344
```bash
347345
Shift >> Shift
348346
Control >> Control
349-
AltLeft >> AltLeft
347+
Alt >> Alt
350348
```
351349
and automatically suppresses the forwarded keys in the output:
352350
```bash

keymapper.conf

+36-33
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11

22
# define some aliases
3-
Alt = AltLeft
4-
AltGr = AltRight
5-
Win = Meta
3+
Alt = AltLeft
4+
AltGr = AltRight
5+
Win = Meta
6+
Command = Meta
67

78
# immediately forward common modifier keys (also used as mouse modifiers)
8-
Shift >> Shift
9-
Control >> Control
10-
Alt >> Alt
9+
@forward-modifiers Shift Control Alt
1110

1211
# define a virtual "boss" key, which can be toggled using the scroll-lock key
1312
# when the boss key is "pressed", the keyboard should be intuitively useable
@@ -27,10 +26,10 @@ ScrollLock >> Boss
2726
Ext >>
2827

2928
# map Ext-S/D/F to Alt/Shift/Control
30-
Ext{S} >> AltLeft
29+
Ext{S} >> Alt
3130
Ext{D} >> Shift
3231
Ext{F} >> Control
33-
Ext{A} >> AltLeft # also map A because of S/D rollover
32+
Ext{A} >> Alt # also map A because of S/D rollover
3433

3534
# Ext-W and the navigation keys should step in/out/over during debugging
3635
Ext{W{L}} >> debug_step_into
@@ -59,7 +58,7 @@ ScrollLock >> Boss
5958
Ext{E} >> Control{F}
6059
Ext{Z} >> edit_undo
6160
(Ext Shift){Z} >> edit_redo
62-
Ext{Z} >> Control{Y}
61+
Ext{F} >> find
6362

6463
Ext{Comma} >> navigate_back
6564
Ext{Period} >> navigate_fore
@@ -108,6 +107,7 @@ ScrollLock >> Boss
108107
(Shift AltGr){Semicolon} >> 'Ö'
109108
AltGr{Semicolon} >> 'ö'
110109
AltGr{D} >> 'ß'
110+
AltGr{Q} >> '@'
111111
AltGr{Backquote} >> '°'
112112

113113
E >> F
@@ -138,11 +138,11 @@ ScrollLock >> Boss
138138
BracketLeft >> '['
139139
Shift{BracketRight} >> '}'
140140
BracketRight >> ']'
141-
Shift{Backquote} >> '`'
141+
Shift{Backquote} >> Shift{Equal} Space # dead key '`'
142142
Backquote >> '~'
143143
Shift{2} >> '@'
144144
Shift{3} >> '#'
145-
Shift{6} >> '^'
145+
Shift{6} >> Backquote Space # dead key '^'
146146
Shift{7} >> '&'
147147
Shift{8} >> '*'
148148
Shift{9} >> '('
@@ -161,20 +161,21 @@ ScrollLock >> Boss
161161
suspend_machine >> Any
162162
poweroff_machine >> Any
163163
reboot_machine >> Any
164-
close_window >> !Win Alt{F4}
164+
close_window >> Alt{F4}
165165
navigate_escape >> Escape
166-
cursor_home >> !Control Home
167-
cursor_end >> !Control End
166+
cursor_home >> Home
167+
cursor_end >> End
168168
open_file >> Control{O}
169169
navigate_back >> Alt{ArrowLeft}
170170
navigate_fore >> Alt{ArrowRight}
171-
next_tab >> !Win Control{PageUp}
172-
prev_tab >> !Win Control{PageDown}
171+
next_tab >> Control{PageUp}
172+
prev_tab >> Control{PageDown}
173173
edit_copy >> Control{C}
174174
edit_cut >> Control{X}
175175
edit_paste >> Control{V}
176176
edit_undo >> Control{Y}
177-
edit_redo >> !Shift Control{Z}
177+
edit_redo >> Control{Z}
178+
find >> Control{F}
178179
build >> Control{B}
179180
debug_step_over >> F10
180181
debug_step_into >> F11
@@ -183,33 +184,34 @@ ScrollLock >> Boss
183184

184185
# system/application specific mappings for abstract commands
185186
[system="MacOS"]
186-
close_window >> Meta{Q}
187-
cursor_home >> !Control Meta{ArrowLeft}
188-
cursor_end >> !Control Meta{ArrowRight}
189-
edit_cut >> Meta{X}
190-
edit_copy >> Meta{C}
191-
edit_paste >> Meta{V}
192-
edit_undo >> Meta{Y}
193-
edit_redo >> (Meta Shift){Y}
187+
close_window >> Command{Q}
188+
cursor_home >> Command{ArrowLeft}
189+
cursor_end >> Command{ArrowRight}
190+
edit_cut >> Command{X}
191+
edit_copy >> Command{C}
192+
edit_paste >> Command{V}
193+
edit_undo >> Command{Y}
194+
edit_redo >> (Command Shift){Y}
195+
find >> Command{F}
194196

195197
[system="Linux"]
196-
lower_window >> !Win (Alt Shift){PageDown}
198+
lower_window >> (Alt Shift){PageDown}
197199

198200
[system="Linux" class="Thunar"]
199201
cursor_home >> Backspace
200202
cursor_end >> Enter
201-
open_terminal >> !Win (Shift Control){C}
203+
open_terminal >> (Shift Control){C}
202204

203205
[system="Linux" class="tilix"]
204-
close_window >> !Win (Shift Control){W}
206+
close_window >> (Shift Control){W}
205207
edit_paste >> (Shift Control){V}
206-
open_terminal >> !Win ContextMenu ^ Enter
208+
open_terminal >> ContextMenu ^ Enter
207209

208210
[system="Windows"]
209-
suspend_machine >> !Control !Alt Win{X} 300ms U S
210-
poweroff_machine >> !Control !Alt Win{X} 300ms U U
211-
reboot_machine >> !Control !Alt Win{X} 300ms U R
212-
lower_window >> !Win Alt{Escape}
211+
suspend_machine >> Win{X} 300ms U S
212+
poweroff_machine >> Win{X} 300ms U U
213+
reboot_machine >> Win{X} 300ms U R
214+
lower_window >> Alt{Escape}
213215
open_terminal >> $(start cmd)
214216

215217
[system="Windows" class="CabinetWClass"] # Windows Explorer
@@ -244,3 +246,4 @@ ScrollLock >> Boss
244246

245247
[title="Geany"]
246248
go_to_definition >> (Control Shift){T}
249+

0 commit comments

Comments
 (0)