########## jk's (gaming) pc setup 2022-10-09.1 ########## ## Order matters: The first matching macro always wins, ## so it's better to define all select-modes first. ###### Global priority settings ###### ## Scroll Lock is magic, sets modes, uses LED. ## First remap it as an internal: EXTRA_F10 remapblock SCROLL_LOCK EXTRA_F10 endblock ## With Ctrl + Shift, the physical Scroll Lock key (always) has ## the normal Scroll Lock key function available. ## As the Scroll Lock LED is used to indicate gaming mode (1), ## this way of using it will (de)synchronize the LED / mode state. macroblock macro EXTRA_F10 CTRL SHIFT -ALT -GUI push_meta clear_meta all press SCROLL_LOCK pop_all_meta endmacro ## in gaming mode (1), remapped as EXTRA_F9 instead macro EXTRA_F9 CTRL SHIFT -ALT -GUI push_meta clear_meta all press SCROLL_LOCK pop_all_meta endmacro endblock ###### Special translation mode (2) ###### ## Mode toggled with Ctrl + Num Lock (configured later) ## Defines a new layer (=modifier): keys with Menu (=APP) key down, ## has special mappings for FI keyboard used with US layout ifselect 2 remapblock ## Bind Menu key (APP) as modifier FN1 APP FN1 endblock layerblock ## Set modifier FN1 to activate layer 1 key remap blocks FN1 1 endblock remapblock ## Define layer 1 keymap, ie. these are active ## with Mode 2 active AND the Menu (APP) key down. layer 1 ## [';S and numpad period key magic. Intended functionality ## requires macros, have to rebind to internal codes first. LEFT_BRACE EXTRA_F1 QUOTE EXTRA_F2 SEMICOLON EXTRA_F3 S EXTRA_F4 PAD_PERIOD EXTRA_F5 endblock macroblock ## (Shift +) Menu + [ = Åå (US intl layout) macro EXTRA_F1 -ALT -CTRL -GUI set_meta RALT press W clear_meta RALT endmacro ## (Shift +) Menu + ' = Ää (US intl layout) macro EXTRA_F2 -ALT -CTRL -GUI set_meta RALT press Q clear_meta RALT endmacro ## (Shift +) Menu + ; = Öö (US intl layout) macro EXTRA_F3 -ALT -CTRL -GUI set_meta RALT press P clear_meta RALT endmacro ## (Shift +) Menu + S = Šš (Alt + Numpad trick) macro EXTRA_F4 SHIFT -ALT -CTRL -GUI push_meta clear_meta all set_meta LALT press PAD_0 press PAD_1 press PAD_3 press PAD_8 clear_meta LALT pop_all_meta endmacro macro EXTRA_F4 -ALT -CTRL -GUI -SHIFT clear_meta all set_meta LALT press PAD_0 press PAD_1 press PAD_5 press PAD_4 clear_meta LALT pop_all_meta endmacro ## Bind the numeric keypad period to send a regular period key ## instead, or a regular comma key with Shift. Lastly, add ## normal keypad period function with the Menu (APP) key down. macro PAD_PERIOD SHIFT -CTRL -ALT -GUI push_meta clear_meta all press COMMA pop_all_meta endmacro macro PAD_PERIOD -SHIFT -CTRL -ALT -GUI press PERIOD endmacro macro EXTRA_F5 press PAD_PERIOD endmacro endblock ###### Gaming mode, Scroll Lock (LED) is/should be on ###### ## mode toggled with physical Scroll Lock key (configured later) ifselect 1 remapblock ## remap S/C.Lock keys to internal codes to override default macros SCROLL_LOCK EXTRA_F9 CAPS_LOCK EXTRA_F8 endblock macroblock ## Physical Scroll Lock key to revert to the default mode ## First toggles Scroll Lock (hopefully off -> LED off) ## (Could use SELECT_1 to just clear the gaming mode) macro EXTRA_F9 -SHIFT -CTRL -ALT -GUI press SCROLL_LOCK press SELECT_0 endmacro ## Ctrl + Num Lock to switch directly to Special translation mode (2) macro NUM_LOCK CTRL -ALT -GUI -SHIFT clear_meta CTRL press SCROLL_LOCK press SELECT_0 press SELECT_2 endmacro ## Revert sleep shortcut (Ctrl + Shift + Pause) to normal key behaviour macro PAUSE CTRL SHIFT -ALT -GUI press PAUSE endmacro ## Remap physical Caps Lock key as F22 ## (used as PTT key Steam, games) macro EXTRA_F8 make F22 onbreak norestoremeta break F22 endmacro endblock ###### Normal/default mode (0), Scroll Lock is/should be off ###### ## NOTE: the "any" ruleset (0) is _always_ active, but due to remaps ## in gaming mode, EXTRA_F10 and Caps Lock keys don't exist anymore ## when processing gets down here, so their macros aren't executed. ifselect any macroblock ## Physical Scroll Lock key to select game mode (1): ## First toggles Scroll Lock (hopefully to on -> LED on), ## then resets all selects disabling secondary modes, ## finally enters Gaming mode (SELECT_1) macro EXTRA_F10 -SHIFT -ALT -GUI -CTRL press SCROLL_LOCK press SELECT_0 press SELECT_1 endmacro ## Num Lock with Ctrl to toggle Special translation mode (2) macro NUM_LOCK CTRL -ALT -GUI -SHIFT press SELECT_2 endmacro ## Bind Caps Lock as Escape, Shift + Caps Lock as a normal ## Caps Lock key. The 100 ms delay makes this reliable, as it ## seems that some os's filter short presses of Caps Lock. macro CAPS_LOCK SHIFT -ALT -GUI -CTRL make CAPS_LOCK onbreak norestoremeta delay 100 break CAPS_LOCK endmacro macro CAPS_LOCK make ESC onbreak norestoremeta break ESC endmacro ## Windows to sleep with Crtl + Shift + Pause ## ie. hits Winkey+X -> sh[U]tdown -> [S]leep ## (Using the SYSTEM_SLEEP key just doesn't work.) macro PAUSE CTRL SHIFT -ALT -GUI push_meta clear_meta all set_meta LGUI press X clear_meta LGUI SHIFT delay 20 press U delay 20 press S pop_all_meta endmacro endblock ## EOF