kmonad / kmonad

An advanced keyboard manager
MIT License
4k stars 321 forks source link

Is awareness of lock state possible (if caps/num lock is currently on or off)? #278

Open Corey-Keller opened 3 years ago

Corey-Keller commented 3 years ago

Either natively or by combining with another program is fine by me.

What I'm trying to do (to emulate how I have it working in Windows using AutoHotkey):

From reading the ./keymap/tutorial.kbd it looks like I can do every part with kmonad (although I'm having trouble grasping the exact syntax, my best guess is (defalias cap (multi-tap 500 caps 500 caps 500 sft)) but that's not valid) except the bolded part (which I'm hoping can be done natively, or at least by assigning the press to some command that can)

EDIT: Here is the AHK script for reference. If such functionality isn't currently possible I'm hoping it might be as part of the refactor?

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
CapsLock::

if A_PriorHotkey = CapsLock

{

if A_TimeSincePriorHotkey < 500

{

SetCapsLockState, on

return

}

}

SetCapsLockState, on

keywait, CapsLock

SetCapsLockState, OFF

return
david-janssen commented 3 years ago

Interesting idea. Going to label this as someday, since we are not ready yet to really delve into redoing the internals, but this is definitely something I'll keep in the back of my head.