mooz / xkeysnail

Yet another keyboard remapping tool for X environment
891 stars 112 forks source link

Introduce variables #105

Closed bb2020 closed 3 years ago

bb2020 commented 3 years ago

This PR introduces variable set and test functions into transform. It also takes an argument to optionally modify the mark.

Actually I was planning to modify the mark like this: [K("F3"), set_var("aa", True), set_mark(False)]. However I've never managed to get it working properly.

Here is an example to emulate Emacs isearch functionality in XKeysnail with variables.

K("C-s"): [K("F3"), set_var("aa", True, False)],
K("C-r"): [K("Shift-F3"), set_var("aa", True, False)],
K("C-g"): [K("esc"), set_var("aa", False, False)],
K("enter"): if_var("aa", K("esc"), K("enter"), False)