Created
July 13, 2023 18:10
-
-
Save leotaku/8223ce6e96146a5ff4fc942a88a54610 to your computer and use it in GitHub Desktop.
Simple evscript xcape configuration.
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
| //! [device] # this section is optional, all these fields have nice defaults | |
| //! name = "evscript demo" | |
| //! bustype = 6 # https://github.com/cmr/evdev/blob/04761b788fcd6722b6283fb98d1578b81559fd1a/src/lib.rs#L471-L489 | |
| //! vendor = 1 | |
| //! product = 2 | |
| //! version = 3 | |
| //! [events] # this is required! because the kernel will violently reject events not defined here | |
| //! keys = ['ESC', 'RIGHTALT'] | |
| fn main() ~ evdevs, uinput { | |
| should_esc := true | |
| loop { | |
| evts := next_events(evdevs) | |
| for i { | |
| evt := evts[i] | |
| xcape(mut should_esc, evt, KEY_RIGHTALT(), [KEY_ESC()]) | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment