diff --git a/README.md b/README.md index c698bdc..b264543 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ Here's what I've done so far: * install [build-essential](https://askubuntu.com/a/753113/882709) to get `make` * run `make setup_locale setup_zshrc setup_tmux_a setup_nvim setup_editorconfig setup_client_mynetwork` * configure nvim clipboard to use system clipboard - had to setup some yank - * install autohotkey: + * install autohotkey: `sa` * TODO: shift and space * Next steps: * TODO: nvim + tmux pasteboard should play with windows pasteboard diff --git a/sas-cae.ahk b/sas-cae.ahk new file mode 100644 index 0000000..feb0f89 --- /dev/null +++ b/sas-cae.ahk @@ -0,0 +1,116 @@ +; this file contains two mods: shift-and-space and control-and-escape + +; shift-and-space script +; source: https://stackoverflow.com/a/39226212 +#InputLevel, 10 ;set send level for the following code to 10 +$Space:: +#InputLevel ;set it back to default value of 0 for any remaining code +now := A_TickCount +while GetKeyState("Space", "P") ; to find out whether space-bar is held + if (A_TickCount-now > 100) ; this time is tested on asker's computer + { + SendInput {Shift Down} + KeyWait, Space + SendInput {Shift Up} + return + } + + +SendInput {Space} ; if key detected to be tapped, send space as per normal +return + + +; control-and-escape script +; source: https://gist.github.com/nocaoper/b872f97cda29bd8f0f2617606abd9fe4 +LShift & Capslock:: +SetCapsLockState, % (State:=!State) ? "on" : "alwaysoff" +Return + +g_AbortSendEsc := false + +#InstallKeybdHook +SetCapsLockState, alwaysoff +Capslock:: +g_DoNotAbortSendEsc := true +Send {LControl Down} +KeyWait, CapsLock +Send {LControl Up} +if ( A_PriorKey = "CapsLock") +{ + if(g_DoNotAbortSendEsc){ + Send {Esc} + } +} +return + +~*^a:: +~*^b:: +~*^c:: +~*^d:: +~*^e:: +~*^f:: +~*^g:: +~*^h:: +~*^i:: +~*^j:: +~*^k:: +~*^l:: +~*^m:: +~*^n:: +~*^o:: +~*^p:: +~*^q:: +~*^r:: +~*^s:: +~*^t:: +~*^u:: +~*^v:: +~*^w:: +~*^x:: +~*^y:: +~*^z:: +~*^1:: +~*^2:: +~*^3:: +~*^4:: +~*^5:: +~*^6:: +~*^7:: +~*^8:: +~*^9:: +~*^0:: +~*^Space:: +~*^Backspace:: +~*^Delete:: +~*^Insert:: +~*^Home:: +~*^End:: +~*^PgUp:: +~*^PgDn:: +~*^Tab:: +~*^Return:: +~*^,:: +~*^.:: +~*^/:: +~*^;:: +~*^':: +~*^[:: +~*^]:: +~*^\:: +~*^-:: +~*^=:: +~*^`:: +~*^F1:: +~*^F2:: +~*^F3:: +~*^F4:: +~*^F5:: +~*^F6:: +~*^F7:: +~*^F8:: +~*^F9:: +~*^F10:: +~*^F11:: +~*^F12:: + g_DoNotAbortSendEsc := false + return