Skip to content

Instantly share code, notes, and snippets.

@leotaku
Created July 13, 2023 18:10
Show Gist options
  • Select an option

  • Save leotaku/8223ce6e96146a5ff4fc942a88a54610 to your computer and use it in GitHub Desktop.

Select an option

Save leotaku/8223ce6e96146a5ff4fc942a88a54610 to your computer and use it in GitHub Desktop.
Simple evscript xcape configuration.
//! [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