-
Notifications
You must be signed in to change notification settings - Fork 0
/
keymapper.conf
1164 lines (903 loc) · 40.7 KB
/
keymapper.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#
# keymapper version >=4.8.1
#
@allow-unmapped-commands
@enforce-lowercase-commands
@forward-modifiers Control AltLeft AltRight
# Debug log file
LOG_FILE = "~/tmp/keymapper.log"
# Gnome keyboard settings
KEY_REPEAT_DELAY = 300
KEY_REPEAT_INTERVAL = 9
# External display brightness
DDC_BRIGHTNESS_INCREMENT = 3
# Input source ids
GNOME_INPUT_SOURCE_US = 0
GNOME_INPUT_SOURCE_FI = 1
@include "include/class_matchers.conf"
@include "include/device_matchers.conf"
@include "include/state_indicators.conf"
@include "include/utils.conf"
@include "include/virtual_modifiers.conf"
@include "include/key_aliases.conf"
@include "include/key_sequences.conf"
@include "include/text_expansion.conf"
# Startup sequence
[default]
ContextActive >> on_startup
on_startup >> createStateDir applyInputDeviceConfig
# ------------ STAGE 1 ---------------
[default]
ContextActive >> stage1["stage 1"]
# Shift and AltGr (ISO Level3 Shift) mappings
[modifier = "!Meta !Control !Alt"]
Shift{2} >> Shift{Quote} # '"'
AltGr{Adiaeresis} >> AltGr{Q} # 'ä'
AltGr{Odiaeresis} >> AltGr{P} # 'ö'
AltGr{E} >> AltGr{5} # '€'
AltGr{1} >> Shift{1} # '!'
AltGr{2} >> Shift{2} # '@'
AltGr{BracketLeft} >> Shift{9} # '('
AltGr{BracketRight} >> Shift{0} # ')'
AltGr{Equal} >> Shift{Equal} # '+'
AltGr{Minus} >> Shift{Slash} # '?'
# Edit mode
[modifier = "EditMode"]
ContextActive >> stage1["EditMode"]
CursorUp >> NavUp
CursorLeft >> NavLeft
CursorDown >> NavDown
CursorRight >> NavRight
Space >> Space
# Alpha modifiers
[modifier = "!Modifier !Space"]
ContextActive >> stage1["modifier = !Modifier !Space"]
? Tap[Edit] >> Edit
Hold[Edit] >> EditMode ^ EditMode
# Tmux modifier
[modifier = "!Modifier !Space", title = " tmux"]
? Tap[Tmux] >> Tmux
Hold[Tmux] >> TmuxMode ^ TmuxMode
# Mirror numpad keys for left hand use
[device = NumpadApayado]
ContextActive >> stage1["device = NumpadApayado"]
Numpad1 >> Numpad3
Numpad3 >> Numpad1
Numpad4 >> Numpad6
Numpad6 >> Numpad4
Numpad7 >> Numpad9
Numpad9 >> Numpad7
NumpadSymbol >> NumpadSymbol
# Space as MetaRight
[modifier = "SpaceMeta"]
ContextActive >> stage1["modifier = SpaceMeta"]
MetaRight >> Meta{Space}
Any >> (MetaRight Any)
[modifier = "!Modifier"]
ContextActive >> stage1["modifier = !Modifier"]
Space{!120ms} >> Space ^
Space{120ms} >> SpaceMeta ^ SpaceMeta
[default]
ContextActive >> stage1["SpaceMeta, default"]
Shift{Space} >> Space
Space >> Space
[device = KeyboardK15Pro]
ContextActive >> stage1["device = KeyboardK15Pro"]
Tap[SpaceLeft] >> Space
[device = KeyboardK3Pro]
ContextActive >> stage1["device = KeyboardK3Pro"]
Tap[ControlRight] >> Escape
[device = KeyboardStandard]
ContextActive >> stage1["device = KeyboardStandard"]
Press[CapsLock] >> Escape
CapsLock !75ms Alpha >> ControlRight{Alpha}
CapsLock >> ControlRight
IntlBackslash >> Backslash
# ------------ STAGE 2 ------------
[stage]
ContextActive >> context["stage 2"]
Meta >> Meta
# KeyLock modiiers
[modifier = "ControlLock"]
ContextActive >> context["modifier = ControlLock"]
Lock >> keyLocksOff ^
Control >> ControlLock keyLockOff["Control"] ^
[modifier = "ShiftLock"]
ContextActive >> context["modifier = ShiftLock"]
Lock >> keyLocksOff ^
Shift >> ShiftLock keyLockOff["Shift"] ^
[modifier = "AltLock"]
ContextActive >> context["modifier = ShiftLock"]
Lock >> keyLocksOff ^
Alt >> AltLock keyLockOff["Alt"] ^
[default]
LockableKey = ControlLeft | Alt | ShiftLeft
# Lock{Control} >> ControlLock ControlLeft ^
# Lock{Alt} >> !Alt AltLock ^
# Lock{Shift} >> ShiftLock ^
ControlLock >> keyLockOn["Control"] ^ keyLockOff["Control"]
ShiftLock >> keyLockOn["Shift"] ^ keyLockOff["Shift"]
AltLock >> keyLockOn["Alt"] ^ keyLockOff["Alt"]
# CapsWord modifier (https://docs.qmk.fm/#/feature_caps_word)
[default]
CapsWordKey = Alpha | Digit | Minus | Backspace
? (ShiftL ShiftR) >> CapsWord ^
CapsWord >> CapsLock setCapsWordStatusOn ^ CapsLock setCapsWordStatusOff
# Forward shift from this point onwards
Shift >> Shift
[modifier = "CapsWord"]
ContextActive >> context["modifier = CapsWord"]
Minus >> Shift{Minus} # '_'
CapsWordKey >> CapsWordKey
Any >> CapsWord Any ^
# DirectUmlauts modifier
[default]
DirectUmlautsTitle = /Pull request|Gmail|Outlook|Slack|WhatsApp|TickTick/i
DirectUmlauts >> setDirectUmlautsStatusOn ^ setDirectUmlautsStatusOff
[modifier = "!Meta !Control !Alt DirectUmlauts", title = DirectUmlautsTitle]
Shift{Comma} >> (Shift Semicolon)
ShiftRight{2} >> (Shift Quote)
Hold[Quote] >> Quote ^
Hold[Semicolon] >> Semicolon ^
Quote >> AltGr{Q}
Semicolon >> AltGr{P}
# AutoShift modifier (https://docs.qmk.fm/#/feature_auto_shift)
[default]
AutoShifted = BracketLeft | BracketRight | Minus | Equal | Comma | Period | Semicolon | Slash | Quote
AutoShift >> setAutoShiftStatusOn ^ setAutoShiftStatusOff
[modifier = "!Meta !AltGr !Control AutoShift"]
Shift{AutoShifted} >> (Shift AutoShifted)
Digit{140ms} !Digit >> (Shift Digit)
AutoShifted{120ms} !AutoShifted >> (Shift AutoShifted)
AutoShifted{Any} >> AutoShifted Any ^
AutoShifted >> AutoShifted
# Sony WH-1000XM, Ugreen Bluetooth dongle
[device = MediaWH1000XM3]
[device = MediaUgreenBTAudio]
MediaPlay >> MediaPlayPause
MediaPause >> MediaPlayPause
# Bluetooth camera shutter button (experiment)
[device = MediaShutterButton]
BTShutterButton = AudioVolumeUp | AudioVolumeDown
BTShutterButton >> Meta{Tab}
# Barcode reader (experiment)
[device = BarcodeReader]
0 >> write["0"]
1 >> write["1"]
2 >> write["2"]
3 >> write["3"]
4 >> write["4"]
5 >> write["5"]
6 >> write["6"]
7 >> write["7"]
8 >> write["8"]
9 >> write["9"]
Enter >> endWrite
# Prevent keyboard auto repeat bug
[device = KeyboardKeychron]
AutoRepeatTime = 5ms
Alpha !AutoRepeatTime Alpha >> Alpha debug["Key auto repeat hit"]
# Key definitions // Keychron K15 Pro
[device = KeyboardK15Pro]
# Rotary encoder
EncoderButton = NumpadEnter
EncoderRight = NumpadAdd
EncoderLeft = NumpadSubtract
# Spotify // Keychron keyboards
[device = KeyboardKeychron, class=/Spotify/i]
ContextActive >> context["device = KeyboardKeychron, class = /Spotify/i"]
FnPlayPause >> MediaPlayPause
FnRewind >> MediaTrackPrevious
FnFastForward >> MediaTrackNext
FnMute >> AudioVolumeMute
FnVolumeDown >> AudioVolumeDown
FnVolumeUp >> AudioVolumeUp
# Encoder mappings for Rofi // Keychron K15 Pro
[device = KeyboardK15Pro, title = /rofi/i]
EncoderButton >> Enter ^
EncoderRight >> ArrowDown
EncoderLeft >> ArrowUp
# JetBrains IDE's // Keychron K15 Pro
[device = KeyboardK15Pro, class = JetBrainsIDE]
# Workaround to use underline shortcuts that conflict with remaps
(Alt SpaceLeft){Alpha} >> _ Alt{Alpha}
# Override i3 keymap to allow easy access to context actions
(Control SpaceLeft){Enter} >> !Control SpaceLeft(Enter)
SpaceLeft{Enter} >> show_context_actions
# Slack // Keychron keyboards
[device = KeyboardKeychron, class = Slack]
Escape{K} >> slack_switch_channel
Escape{1} >> slack_goto_workspace1
Escape{2} >> slack_goto_workspace2
Escape{H} >> slack_goto_home
Escape{A} >> slack_goto_activity
Escape{D} >> slack_goto_dms
Escape{T} >> slack_goto_threads
Escape{L} >> slack_goto_later
Escape{U} >> slack_goto_unread
Escape{Space} >> slack_switch_channel
Escape{F} >> find
Escape{M} >> toggle_mic_mute
Combo[Esc, M] >> toggle_mic_mute
[class = Browser, title = "YouTube"]
Esc{Shift{F}} >> Period
Esc{F} >> Comma
[class = Browser, title = "TIDAL"]
ContextActive >> context["class = Browser, title = -TIDAL"]
FnPlayPause >> Space
FnFastForward >> Control{ArrowRight}
FnRewind >> Control{ArrowLeft}
FnVolumeUp >> AudioVolumeUp
FnVolumeDown >> AudioVolumeDown
FnMute >> AudioVolumeMute
# scrcpy
[class = "scrcpy"]
ContextActive >> context["class = scrcpy"]
ButtonSide >> Alt
# Browser // Azure DevOps pull request
[device = KeyboardKeychron, class = Browser, modifier = "!Modifier", title = /Pull request \d+:/i]
PageUp >> prev_change
PageDown >> next_change
NavDown >> prev_change
NavLeft >> next_change
next_change >> ^ F7
prev_change >> ^ Shift{F7}
# Stylus editor // Keychron keyboards
[device = KeyboardKeychron, title = "Stylus - Google Chrome"]
NavUp >> ArrowUp
NavLeft >> ArrowLeft
NavDown >> ArrowDown
NavRight >> ArrowRight
# GitHub Code Spaces // Keychron keyboards
[device = KeyboardKeychron, class = Browser, title = /Visual Studio Code.*GitHub/i]
NavUp >> ArrowUp
NavLeft >> ArrowLeft
NavDown >> ArrowDown
NavRight >> ArrowRight
Alt{Any} >> Alt{Any}
Control{Any} >> Control{Any}
Escape{W} >> close_tab
Escape{A} >> command_palette
Escape{D} >> goto_definition
Escape{F} >> goto_file
Escape{S} >> goto_workspace_symbol
close_tab >> _ Alt{W}
command_palette >> _ Control{Shift{P}}
goto_definition >> _ F12
goto_file >> _ Control{P}
goto_workspace_symbol >> _ Control{T}
# Browser // Keychron keyboards
[device = KeyboardKeychron, class = Browser]
F11 >> F11 # fullscreen
F12 >> F12 # DevTools
Escape{Digit} >> Alt{Digit}
Escape{N} >> new_window
Escape{G} >> focus_location_bar
Escape{T} >> new_tab
Escape{W} >> close_tab
Escape{P} >> pin_tab
Escape{Z} >> suspend_tab
Escape{B} >> navigate_back
Escape{F} >> navigate_forward
Escape{R} >> reload_page
Escape{Space} >> apply_completion
Combo[Esc, Space] >> apply_completion
Escape{KeyLeft} >> prev_tab
Escape{KeyRight} >> next_tab
Escape{KeyUp} >> shift_tab_left
Escape{KeyDown} >> shift_tab_right
NavLeft >> prev_tab
NavRight >> next_tab
NavUp >> shift_tab_left
NavDown >> shift_tab_right
apply_completion >> _ Tab
# Standard keyboard mappings
[device = KeyboardStandard]
ContextActive >> context["device = KeyboardStandard"]
Hold[Backquote] >> i3Scratchpad
Press[AltRight] >> i3Leader
# Default mappings // Keychron keyboards
[device = KeyboardKeychron]
Combo[Option, Tab] >> DirectUmlauts ^
Combo[Option, ControlRight] >> AutoShift ^
Option{Tab} >> DirectUmlauts ^
Option{ControlRight} >> AutoShift ^
Option{BracketLeft} >> set_keyboard_layout_us
Option{BracketRight} >> set_keyboard_layout_fi
Option{1} >> set_keyboard_layout_us
Option{2} >> set_keyboard_layout_fi
Option{Any} >>
Option >>
Command{Space} >> show_run_menu
Command{Tab} >> show_window_switcher
Command{Enter} >> launch_tmux
Command{O} >> launch_obsidian
Command{U} >> launch_openwebui
Command{S} >> launch_slack
Command{Y} >> launch_spotify
Command{M} >> launch_yt_music
Command{W} >> launch_whatsapp
Command{T} >> launch_telegram
Command{Minus} >> wm_move_to_scratchpad
Meta{Control{D}} >> run_scrcpy_audiovideo
Meta{Shift{D}} >> run_scrcpy_audio
None >> run_scrcpy_video
# Meta{D} >> run_scrpcpy
None >> run_scrpcpy
# Media keys
MetaRight{FnPlayPause} >> MediaPlayPause
MetaRight{FnRewind} >> MediaTrackPrevious
MetaRight{FnFastForward} >> MediaTrackNext
MetaRight{FnMute} >> AudioVolumeMute
MetaRight{FnVolumeDown} >> AudioVolumeDown
MetaRight{FnVolumeUp} >> AudioVolumeUp
# Brightness presets (Macro1 -> 1..6)
Hyper{1} >> brightness_preset_1
Hyper{2} >> brightness_preset_2
Hyper{3} >> brightness_preset_3
Hyper{4} >> brightness_preset_4
Hyper{5} >> brightness_preset_5
Hyper{6} >> brightness_preset_6
# Color temp presets (Macro1 -> 7..0)
Hyper{7} >> color_temp_preset_1
Hyper{8} >> color_temp_preset_2
Hyper{9} >> color_temp_preset_3
Hyper{0} >> color_temp_preset_4
# Display brightness / color temperature adjustment
FnBrightnessReset = FnBrightnessDown | FnBrightnessUp
FnColorTempReset = FnColorTempDown | FnColorTempUp
Meta{FnBrightnessDown} >> ddc_brightness_decrease
Meta{FnBrightnessUp} >> ddc_brightness_increase
Meta{FnColorTempDown} >> color_temp_decrease
Meta{FnColorTempUp} >> color_temp_increase
ControlR{FnBrightnessDown} >> soft_brightness_decrease
ControlR{FnBrightnessUp} >> soft_brightness_increase
AltGr{FnBrightnessReset} >> brightness_reset
AltGr{FnColorTempReset} >> color_temp_reset
# Default mappings // Keychron K3 Pro
[device = KeyboardK3Pro]
ContextActive >> context["device = KeyboardK3Pro"]
Command{i3LeaderBind} >> i3Leader{i3LeaderBind}
Command >> i3Leader
# Default mappings // Keychron K15 Pro
[device = KeyboardK15Pro]
ContextActive >> context["device = KeyboardK15Pro"]
# QMK Macro1+Backquote
RofiHassScene >> show_scene_picker
Command{Lock} >> lock_desktop_session
Command{i3LeaderBind} >> i3Leader{i3LeaderBind}
Command >> i3Leader
# Encoder brigthness and color temperature control
ControlShiftRight = (ControlRight ShiftRight)
ControlShiftRight{EncoderButton} >> color_temp_reset
ControlShiftRight{EncoderRight} >> color_temp_increase
ControlShiftRight{EncoderLeft} >> color_temp_decrease
ControlRight{EncoderButton} >> soft_brightness_reset
ControlRight{EncoderRight} >> soft_brightness_increase
ControlRight{EncoderLeft} >> soft_brightness_decrease
# Encoder media control
AltGr{EncoderButton} >> MediaStop ^
AltGr{EncoderRight} >> MediaTrackNext
AltGr{EncoderLeft} >> MediaTrackPrevious
# Encoder audio control
EncoderButton >> MediaPlayPause ^
EncoderRight >> AudioVolumeUp
EncoderLeft >> AudioVolumeDown
# Global mappings
[default]
# Long-press shortcuts
Hold[Backquote] >> i3Scratchpad
Hold[Backslash] >> launch_tmux
Hold[F3] >> launch_home_assistant
Hold[F4] >> launch_hass_light_tiles
Hold[Equal] >> zoom_in
Hold[Minus] >> zoom_out
# Mark and goto
HoldTwo[Shift, Quote] >> wm_mark_window_long
Hold[Quote] >> wm_mark_window
Hold[Semicolon] >> wm_goto_mark
MetaRight{(Shift Quote)} >> wm_mark_window_long
MetaRight{Quote} >> wm_mark_window
MetaRight{Semicolon} >> wm_goto_mark
MetaRight{S} >> launch_slack
MetaRight{G} >> launch_telegram
MetaRight{E} >> show_emoji_picker
MetaRight{Q} >> wm_close_window
MetaRight{Backquote} >> wm_show_scratchpad
# Workspace switching
MetaRight{P} >> Meta{1}
MetaRight{W} >> Meta{9}
MetaRight{M} >> Meta{0}
# Apayado K33 Numpad
[modifier = "NumpadNavMode NumpadRofiMode"]
ArrowLeft >> Escape NumpadRofiMode
ArrowRight >> Shift{Delete} NumpadRofiMode
NavigationKey >> NavigationKey
Delete >> Delete
Backspace >> Shift{Delete} NumpadRofiMode
Enter >> Enter NumpadRofiMode
Escape >> Escape NumpadRofiMode
[device = NumpadApayado, class = "gnome-calculator"]
ContextActive >> context["device = NumpadApayado, class = gnome-calculator"]
NumLock >> wm_close_window
ScrollLock >> wm_close_window
[device = NumpadApayado, modifier = "NumpadNavMode", class != "gnome-calculator"]
ContextActive >> context["device = NumpadApayado, modifier = NumpadNavMode"]
Numpad0 >> Meta{0}
Numpad1 >> Meta{1}
Numpad2 >> Meta{2}
Numpad3 >> Meta{3}
Numpad4 >> Meta{4}
Numpad5 >> Meta{5}
Numpad6 >> Meta{6}
Numpad7 >> Meta{7}
Numpad8 >> Meta{8}
Numpad9 >> Meta{9}
NumpadDecimal >> Meta{M}
NumpadAdd >> Meta{Equal}
NumpadEnter >> Meta{P}
Home >> Meta{BracketLeft}
End >> Meta{G}
Insert >> Meta{O}
Delete >> Meta{S}
PageUp >> $(i3-msg "scratchpad show scratchpad show")
PageDown >> $(i3-msg "scratchpad show")
ArrowUp >> Escape NumpadRofiMode Meta{N}
ArrowDown >> Meta{N} ^ Escape
ArrowLeft >> Meta{Shift{Tab}}
ArrowRight >> Meta{Tab}
[device = NumpadApayado]
Numpad1 >> 1
Numpad2 >> 2
Numpad3 >> 3
Numpad4 >> 4
Numpad5 >> 5
Numpad6 >> 6
Numpad7 >> 7
Numpad8 >> 8
Numpad9 >> 9
Numpad0 >> 0
NumpadSymbol >> NumpadSymbol
# NumpadDigit >> NumpadDigit
ScrollLock >> NumpadNavMode
NumLock >> launch_calculator
# Mouse buttons // Logitech G502 X
[device = MouseG502X]
DoubleTap[ButtonSide] >> wm_float_window
Hold[ButtonMiddle] >> wm_sticky_toggle
ButtonForward{150ms} >> mouse_drag
ButtonBack{150ms} >> mouse_drag_resize
[device = MouseG502X, modifier = "ButtonSide"]
ContextActive >> context["device = MouseG502X, modifier = ButtonSide"]
DoubleTap[ButtonLeft] >> wm_resize_window
DoubleTap[ButtonRight] >> wm_close_window
ButtonLeft >> wm_center_window
ButtonRight >> wm_resize_window_wide
ButtonMiddle >> wm_float_window
WheelUp >> zoom_in
WheelDown >> zoom_out
WheelLeft >> Meta{Shift{Tab}}
WheelRight >> Meta{Tab}
# Mouse buttons // Logitech MX Anywhere 2S
[device = MouseMXAnywhere]
ButtonMiddle{150ms} >> wm_float_window
# Mouse scroll lock // Logitech Trackball (note, this affects all pointer devices)
[modifier = MouseScrollLock]
ContextActive >> context["modifier = MouseScrollLock"]
MouseButton >> MouseScrollLock
[default]
MouseScrollLock >> ButtonMiddle
# Mouse Buttons // Logitech Trackball
[device = MouseTrackball]
# ContextActive >> context["device = MouseTrackball"]
DoubleTap[ButtonLeft] >> ButtonBack
DoubleTap[ButtonRight] >> ButtonForward
(ButtonLeft ButtonRight) >> MouseScrollLock
ButtonLeft >> ButtonRight
ButtonRight >> ButtonLeft
ButtonForward >> ButtonMiddle
# Mouse buttons // All mice
[device = AnyMouse, modifier = "Shift"]
WheelLeft >> WheelLeft
WheelRight >> WheelRight
[device = AnyMouse]
Meta{ButtonLeft} >> wm_float_window
Meta{ButtonRight} >> wm_move_to_scratchpad
Meta{ButtonMiddle} >> wm_close_window
Meta{WheelLeft} >> Meta{KeyLeft}
Meta{WheelRight} >> Meta{KeyRight}
WheelLeft >> prev_tab
WheelRight >> next_tab
# Tmux mode
[modifier = "TmuxMode"]
ContextActive >> stage1["TmuxMode"]
TmuxPrefix = (Control A)
TmuxBinding = Direction | Digit | C | N | P | O | W | Z | Backslash | BracketLeft | BracketRight | Comma | Minus | Period | Semicolon | Slash
TmuxBinding >> _ TmuxPrefix{10ms} 10ms TmuxBinding
# Terminal // Default mappings
[class = Terminal]
ContextActive >> context["class = Terminal"]
NavUp >> ArrowUp
NavLeft >> ArrowLeft
NavDown >> ArrowDown
NavRight >> ArrowRight
# Copy/paste
Copy >> Control{Shift{C}}
Paste >> Control{Shift{V}}
AltBinding = Alpha | Digit | Symbol | Space | Tab
# Escape to Alt
Escape{AltBinding} >> _ Alt{AltBinding}
Escape >> Escape
zoom_out >> _ Control{Shift{Minus}}
zoom_in >> _ Control{Shift{Equal}}
# JetBrains IDE // Diff view
[class = JetBrainsIDE, modifier = "!Modifier", title = /Repository Diff/i]
ContextActive >> context["class = JetBrainsIDE, modifier = !Modifier, title = /Repository Diff/i"]
J >> next_difference
K >> prev_difference
N >> compare_next_file
B >> compare_prev_file
D >> goto_declaration
DoubleTap[Escape] >> Escape
Escape >>
# JetBrains IDE // Pull request, commit or stash diff view
[class = JetBrainsIDE, title = /Diff for Pull Request |Commit: |Shelved: |History: |Changes: /i]
ContextActive >> context["class = JetBrainsIDE, title = /Diff for Pull Request |Commit: |Shelved: |History: |Changes: /i"]
NavLeft >> next_difference
NavDown >> prev_difference
Forward >> compare_next_file
Back >> compare_prev_file
Control{J} >> next_difference
Control{K} >> prev_difference
Control{N} >> compare_next_file
Control{P} >> compare_prev_file
DoubleTap[Escape] >> Escape
Escape >>
# JetBrains IDE // VCS changes
[class = JetBrainsIDE, modifier = "!AltGr", title = /Commit Changes|Commit: /i]
ContextActive >> context["class = JetBrainsIDE, modifier = !AltGr, title=/Settings|Commit Changes|Commit: /i"]
Control{J} >> next_difference
Control{K} >> prev_difference
Control{N} >> compare_next_file
Control{Shift{N}} >> compare_prev_file
# JetBrains IDE // Keychron K15 Pro mappings
[class = JetBrainsIDE, device = KeyboardKeychron]
ContextActive >> context["class = JetBrainsIDE, device = KeyboardKeychron, keymaps"]
Shift{Find} >> replace_in_files
Find >> find_in_files
Help >> show_hover_info
Exec >> prefix_git_action
Erase >> rollback_change
AltGr{Shift{Delete}} >> cut_to_line_end
AltGr{Delete} >> delete_to_line_end
# JetBrains IDE // Default mappings
[class = JetBrainsIDE]
ContextActive >> context["class = JetBrainsIDE, keymaps"]
# Use numpad as arrow keys
NavUp >> ArrowUp
NavLeft >> ArrowLeft
NavDown >> ArrowDown
NavRight >> ArrowRight
# Tool window shortcuts
Hold[Digit] >> Alt{Digit} ^
# Function key shortcuts
Hold[FunctionKey] >> Control{FunctionKey} ^
Combo[Esc, Direction] >> (Control AltGr){Direction}
Escape{Direction} >> !Escape (Control AltGr){Direction}
Alt{Direction} >> (Alt AltGr){Direction}
ControlRight{KeyLeft} >> Control{ArrowLeft}
ControlRight{KeyRight} >> Control{ArrowRight}
Combo[Esc, Shift{Slash}] >> toggle_block_comment
Combo[Esc, Slash] >> toggle_comment
_ Shift{Escape} >> close_tool_window
BrowserBack >> navigate_back
BrowserForward >> navigate_forward
Control{BracketLeft} >> Control{BracketLeft} # move caret to previous paragraph
Control{BracketRight} >> Control{BracketRight} # move caret to next paragraph
# TODO: Currently overrides KJump
Combo[Esc, Space] >> accept_completion
Escape{Space} >> accept_completion
KJump = Combo[Escape, Space]
JTarget = W | J | F | G | L | C | Space | Comma | Enter
KJump >> Control{Comma}
Esc{G} T >> jump_to_top
Esc{G} B >> jump_to_bottom
Esc{G} I >> jump_to_text_start
Esc{G} K >> jump_to_text_end
Esc{G} L >> jump_to_line
Esc{G} W >> jump_to_word
Esc{G} C >> jump_to_character
Esc{G} P >> toggle_problems
Escape{T} >> toggle_terminal
Escape{F} >> find
Escape{R} >> replace
Escape{W} >> close_tab
None >> join_lines
Escape{A} >> show_actions
Escape{Q} >> show_quick_documentation
F1 >> show_hover_info
Escape{D} >> goto_declaration
Escape{Y} >> goto_type_declaration
Escape{B} >> goto_implementation
Escape{P} >> goto_file
Escape{S} >> goto_symbol
Escape{5} >> jump_to_matching_brace
Escape{Quote} >> jump_to_last_edit_loc
Escape{N} >> next_difference
Escape{E} >> next_error
Escape{Z} >> rollback_change
Escape >> Escape
BracketLeft{BracketRight} >> BracketLeft BracketRight
BracketLeft{100ms} >>
BracketLeft{E} >> prev_error
BracketLeft{C} >> prev_change
BracketLeft{F} >> prev_function
BracketLeft{Any} >>
BracketRight{100ms} >>
BracketRight{E} >> next_error
BracketRight{C} >> next_change
BracketRight{F} >> next_function
BracketRight{Any} >>
AltGr{Enter} >> extend_selection
(Shift AltGr){Enter} >> shrink_selection
# JetBrainsIDE // IDE actions
[class = JetBrainsIDE]
ContextActive >> context["class = JetBrainsIDE, actions"]
prefix_git_action >> _ Alt{G}
close_tab >> Alt{W}
close_tool_window >> Shift{Escape}
find >> Control{F}
find_in_files >> (Control Shift){F}
replace >> Control{R}
replace_in_files >> (Control Shift){R}
show_actions >> _ Alt{A}
show_context_actions >> _ Alt{Enter}
show_hover_info >> Control{F1}
show_quick_documentation >> Control{Q}
toggle_terminal >> ^ Alt{T}
toggle_problems >> ^ Alt{8}
goto_file >> Alt{P}
goto_symbol >> Alt{S}
goto_declaration >> Control{B}
goto_type_declaration >> (Control Shift){B}
goto_implementation >> Control{Alt{B}}
jump_to_text_start >> Control{Home}
jump_to_text_end >> Control{End}
jump_to_top >> Control{PageUp}
jump_to_bottom >> Control{PageDown}
jump_to_line >> Control{G}
jump_to_character >> Alt{Comma}
jump_to_word >> Control{Comma}
jump_to_matching_brace >> Control{Shift{M}}
jump_to_last_edit_loc >> Alt{Shift{E}}
next_error >> _ Alt{Escape}
prev_error >> _ Alt{Shift{Escape}}
next_function >> _ Alt{ArrowDown}
prev_function >> _ Alt{ArrowUp}
rollback_change >> (Control Alt){Z}
next_change >> (Control Alt){ArrowDown}
prev_change >> (Control Alt){ArrowUp}
next_difference >> (Control Alt){ArrowDown}
prev_difference >> (Control Alt){ArrowUp}
compare_next_file >> (Alt Shift){N}
compare_prev_file >> (Alt Shift){J}
extend_selection >> _ Alt{W}
shrink_selection >> _ Alt{Shift{W}}
cut_to_line_end >> _ (Shift Control Alt){Delete}
delete_to_line_end >> _ (Control Alt){Delete}
join_lines >> _ Control{J}
toggle_comment >> _ Control{7}
toggle_block_comment >> _ Control{Shift{7}}
accept_completion >> ^ Tab
# Visual Studio Code
[class = VSCode]
# Use numpad as arrow keys
NavUp >> ArrowUp
NavLeft >> ArrowLeft
NavDown >> ArrowDown
NavRight >> ArrowRight
Escape{P} >> ^ Control{P}
Escape{S} >> goto_workspace_symbol
Escape{W} >> close_tab
Escape{T} >> toggle_terminal
Escape{E} >> next_error
(Control Alt){Any} >> (Control Alt){Any}
(Shift AltGr){Enter} >> shrink_selection
AltGr{Enter} >> expand_selection
(Shift Alt){W} >> shrink_selection
Alt{W} >> expand_selection
Alt{S} >> goto_workspace_symbol
Alt{Any} >> Alt{Any}
Alt >>
Escape !250ms Any >> Control{K} Any
BracketRight{100ms} >>
BracketRight{E} >> next_error
BracketRight{Any} >>
BracketLeft{100ms} >>
BracketLeft{E} >> prev_error
BracketLeft{Any} >>
goto_workspace_symbol >> _ Control{T}
next_error >> _ Alt{F8}
prev_error >> _ Alt{Shift{F8}}
toggle_terminal >> _ Alt{T}
expand_selection >> _ Alt{Shift{ArrowRight}}
shrink_selection >> _ Alt{Shift{ArrowLeft}}
# Obsidian
[class = Obsidian]
ContextActive >> context["class = Obsidian"]
Escape{Direction} >> _ Alt{Direction}
Escape{A} >> command_palette
Escape{N} >> new_note
Escape{T} >> new_tab
Escape{W} >> close_tab
Escape{P} >> quick_switcher
Escape{Comma} >> toggle_left_sidebar
Escape{Period} >> toggle_right_sidebar
Escape >> Escape
new_note >> _ Control{N}
quick_switcher >> _ Control{O}
command_palette >> _ Alt{A}
toggle_left_sidebar >> _ Alt{Comma}
toggle_right_sidebar >> _ Alt{Period}
# Teams for Linux
[class = TeamsForLinux]
ContextActive >> context["class = TeamsForLinux"]
Escape{M} >> toggle_mic_mute
Escape{H} >> toggle_raised_hand
Escape{L} >> leave_call
Combo[Esc, M] >> toggle_mic_mute
Combo[Esc, H] >> toggle_raised_hand
Combo[Esc, L] >> leave_call
AltGr{M} >> toggle_mic_mute
AltGr{H} >> toggle_raised_hand
AltGr{L} >> leave_call
toggle_mic_mute >> _ Control{Shift{M}} ^
toggle_raised_hand >> _ Control{Shift{K}} ^
leave_call >> _ Control{Shift{H}} ^
# Browser defaults
[class = Browser]
ContextActive >> context["class = Browser"]
# Mouse wheel zoom from either Control
ControlRight >> ControlLeft
EitherAlt{N} >> new_window
EitherAlt{T} >> new_tab
AltGr{R} >> reload_page
AltGr{Z} >> suspend_tab
AltGr{S} >> suspend_tab_pause
Alt{Shift{KeyLeft}} >> shift_tab_left
Alt{Shift{KeyRight}} >> shift_tab_right
Alt{KeyLeft} >> prev_tab
Alt{KeyRight} >> next_tab
Alt{KeyUp} >> scroll_up