I'm a long time ahk fan, and my personal ahk script holds 5000 keymappings, including wrapper keymaps around nearly everything, from system things to Intellij Idea, Gvim, Firefox+Keyconfig and Firebug, ConEmu and anything using hotkeys.
The mappings themselves are pretty primitive, and rarely include more than 5 lines, for complex tasks I prefer other languages depending on the situation.
But due to lack of keys, many keymaps are difficult to manage. I normally create some additional context GUI windows and use #ifwinexist or WinExist() etc. for determining what key means in the current situation. It sort of tedious and might be automated.
I'm wondering what if we had a fully declarative css-like abstract syntax like this:
.winActiveClass #winExistsId windowName !controlName @systemVariable[userProfile=Work] {
key: action;
}
* {!f4: closeWindow; !s: settings; } // works for all windows, including cmd
.textEditor {^y: deleteLine; } // deletes line in all defined textEditors
!browserCommandLine {
BackSpace: removeOneLevelInUrl;
!Backspace: removeAllExceptDomain;
!+Backspace: removeQuery;
}
so, from one side it would simplify managing the mappings and contexts, and also it could generalize the common actions: window management, tab management, forms input, text copy/edit, paging and navigation, search, settings. Or specific cycles like write/compile/build/debug/log etc.
Ideally, I could imagine a cross-platform standard, compiling into specific OS).
Does it look promising?
What tools could be used for that?
What traps and obstacles could you see?
Did anyone try this before?
Thanks in advance!!