valpackett / evscript

A tiny sandboxed Dyon scripting environment for evdev input devices that lets you do e.g. xcape in Wayland | now on https://codeberg.org/valpackett/evscript
https://codeberg.org/valpackett/evscript
The Unlicense
121 stars 7 forks source link

[request] add a SpaceFN function to your stdlib.dyon? #2

Open hgersen opened 6 years ago

hgersen commented 6 years ago

SpaceFN is a concept that uses the spacebar as an additional mod key, see https://geekhack.org/index.php?topic=51069.0

Currently there doesn't appear to be a clean implementation under Linux. As a result implementing this could be a real demonstration of how useful evscript can be. Do you think that is possible?

btw) this doesn't work well when using xcape as xcape lacks rollover detection (see topic I link to above).

valpackett commented 6 years ago

hmm — evscript cannot remove emitted events, only create new ones (on a separate device) — so preventing the spacebar from repeating is not possible in a straightforward way.

I guess you'd have to remap the spacebar to some other key using… something (layouts in kernel?), and configure evscript to emit the space key when that key is pressed on its own.

Or use evscript as a proxy — forward all events from the original keyboard, modifying the spacebar — if you can prevent your compositor from picking up the original keyboard (something about udev labels?). I'm not a fan of this idea (a bit brittle and slightly increases latency), but I guess that shows the flexibility :)

hgersen commented 6 years ago

I have not yet played with Wayland, but for X11 I do remap 'normal' keys using XCB, before xcape comes into play. The same thing would work for the spacebar, although don't know how to do that for wayland yet.

Are you saying that with a remapped spacebar one could implement SpaceFN relatively easily using your library?

btw) sorry for the question, but rust is not a language I'm that familiar with....and hence don't really see how to do this.

valpackett commented 6 years ago

I mean, if you remap at a lower level, before evscript comes into play.

(btw, not a library, an executable that runs scripts written in Dyon, not Rust)