Last active
February 19, 2025 17:12
-
-
Save TarVK/40181651e9bf2ee18e08865d51b21024 to your computer and use it in GitHub Desktop.
A second keyboard layer for programming I am using
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#NoEnv | |
#UseHook | |
RAlt::BS | |
; Add fake alt | |
CapsLock::LAlt | |
; Detect alt | |
$LAlt:: isAltDown := TRUE | |
$LAlt UP:: isAltDown := FALSE | |
#if isAltDown | |
; LAlt + jkli (left, down, up, right) | |
l::Right | |
j::Left | |
i::Up | |
k::Down | |
; LAlt + uo (home, end) | |
u::Home | |
o::End | |
; LAlt + sxdcfvgb ([, ], (, ), {, }, <, >) | |
s::Send {[} | |
x::Send {]} | |
d::Send {(} | |
c::Send {)} | |
f::Send {{} | |
v::Send {}} | |
g::Send {<} | |
b::Send {>} | |
; LAlt + azqwertyhn (=, !, &, |, -, +, @, *, /, \, _) | |
a::Send {=} | |
z::Send {!} | |
q::Send {&} | |
w::Send {|} | |
e::Send {-} | |
r::Send {+} | |
t::Send {@} | |
y::Send {*} | |
h::Send {/} | |
n::Send {\} | |
/::Send {_} | |
; LAlt + <> (Ctrl + z, ctrl + y) | |
,::^z | |
.::^y | |
; LAlt + p; (Ctrl + c, ctrl + v) | |
p::^c | |
`;::^v | |
; Delete | |
RAlt::Delete | |
; Escape | |
$Space::Escape |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// usage: | |
// - place in file "/usr/share/X11/xkb/symbols/tar" | |
// - run terminal command "setxkbmap -layout tar" | |
// | |
// debugging: | |
// - "setxkbmap -layout tar -print | xkbcomp -I$HOME/.xkb - $DISPLAY" | |
// - "xkbcomp $DISPLAY - > dump.xkb" | |
// | |
// Resources: | |
// - https://www.charvolant.org/doug/xkb/html/node5.html, | |
// - https://wiki.archlinux.org/title/X_keyboard_extension, | |
// - https://wiki.linuxquestions.org/wiki/List_of_Keysyms_Recognised_by_Xmodmap | |
default partial alphanumeric_keys modifier_keys | |
xkb_symbols "basic" { | |
name[Group1]= "Tar (US)"; | |
key <LALT> { | |
[ Mode_switch, Mode_switch] | |
}; | |
key <CAPS> {[ Alt_L ]}; // Restore alt ability | |
key <RALT> { | |
[ BackSpace, BackSpace], | |
symbols[group2] = [Delete, Delete] | |
}; | |
key <TLDE> {[ grave, asciitilde ]}; | |
key <AE01> {[ 1, exclam ]}; | |
key <AE02> {[ 2, at ]}; | |
key <AE03> {[ 3, numbersign ]}; | |
key <AE04> {[ 4, dollar ]}; | |
key <AE05> {[ 5, percent ]}; | |
key <AE06> {[ 6, asciicircum ]}; | |
key <AE07> {[ 7, ampersand ]}; | |
key <AE08> {[ 8, asterisk ]}; | |
key <AE09> {[ 9, parenleft ]}; | |
key <AE10> {[ 0, parenright ]}; | |
key <AE11> {[ minus, underscore ]}; | |
key <AE12> {[ equal, plus ]}; | |
key <AD01> {[ q, Q ], symbols[group2]=[ampersand]}; | |
key <AD02> {[ w, W ], symbols[group2]=[bar]}; | |
key <AD03> {[ e, E ], symbols[group2]=[minus]}; | |
key <AD04> {[ r, R ], symbols[group2]=[plus]}; | |
key <AD05> {[ t, T ], symbols[group2]=[at]}; | |
key <AD06> {[ y, Y ], symbols[group2]=[asterisk]}; | |
key <AD07> {[ u, U ], symbols[group2]=[Home]}; | |
key <AD08> {[ i, I ], symbols[group2]=[Up]}; | |
key <AD09> {[ o, O ], symbols[group2]=[End]}; | |
key <AD10> { | |
[ p, P ], | |
symbols[group2]=[NoSymbol], | |
actions[group2]=[RedirectKey(keycode=<AB03>, modifiers=Control)] //ctrl+c | |
}; | |
key <AD11> {[ bracketleft, braceleft ]}; | |
key <AD12> {[ bracketright, braceright ]}; | |
key <AC01> {[ a, A ], symbols[group2]=[equal]}; | |
key <AC02> {[ s, S ], symbols[group2]=[bracketleft]}; | |
key <AC03> {[ d, D ], symbols[group2]=[parenleft]}; | |
key <AC04> {[ f, F ], symbols[group2]=[braceleft]}; | |
key <AC05> {[ g, G ], symbols[group2]=[less]}; | |
key <AC06> {[ h, H ], symbols[group2]=[slash]}; | |
key <AC07> {[ j, J ], symbols[group2]=[Left]}; | |
key <AC08> {[ k, K ], symbols[group2]=[Down]}; | |
key <AC09> {[ l, L ], symbols[group2]=[Right]}; | |
key <AC10> { | |
[ semicolon, colon ], | |
symbols[group2]=[NoSymbol], | |
actions[group2]=[RedirectKey(keycode=<AB04>, modifiers=Control)] //ctrl+v | |
}; | |
key <AC11> {[ apostrophe, quotedbl ]}; | |
key <BKSL> {[ backslash, bar ]}; | |
key <AB01> {[ z, Z ], symbols[group2]=[exclam]}; | |
key <AB02> {[ x, X ], symbols[group2]=[bracketright]}; | |
key <AB03> {[ c, C ], symbols[group2]=[parenright]}; | |
key <AB04> {[ v, V ], symbols[group2]=[braceright]}; | |
key <AB05> {[ b, B ], symbols[group2]=[greater]}; | |
key <AB06> {[ n, N ], symbols[group2]=[backslash]}; | |
key <AB07> {[ m, M ]}; | |
key <AB08> { | |
[ comma, less ], | |
symbols[group2]=[NoSymbol], | |
actions[group2]=[RedirectKey(keycode=<AB01>, modifiers=Control)] //ctrl+z | |
}; | |
key <AB09> { | |
[ period, greater ], | |
symbols[group2]=[NoSymbol], | |
actions[group2]=[RedirectKey(keycode=<AD06>, modifiers=Control)] //ctrl+y | |
}; | |
key <AB10> {[ slash, question ], symbols[group2]=[underscore]}; | |
key <SPCE> { | |
symbols[group2]=[NoSymbol], | |
actions[group2]=[RedirectKey(keycode=<ESC>)] // Escape (behaves different than just mapping to symbol "Escape") | |
}; | |
// For safety, ensuring I can always enter even when accidentally removing keys from the pc symbols | |
key <RTRN> {[Return], symbols[group2]=[Return]}; | |
// Overrides Mod1 to an invalid symbol None, to enable key repeat for RAlt even when it's combined with the symbols from pc | |
modifier_map Mod1 { None }; | |
// include "us" | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment