indianakernick / The-Fat-Controller

A library for simulating mouse and keyboard events
Apache License 2.0
38 stars 13 forks source link

Feature flag for X11/"Wayland" mode selection #11

Closed idun-project closed 5 months ago

idun-project commented 6 months ago

Howdy. I want to use tfc only with /dev/uinput, and eliminate the X11 dependencies. Is there any reason to not have a feature flag to enable the X11 mode?

indianakernick commented 5 months ago

Since X11 provides more functionality than /dev/uinput alone, it probably makes sense to use it by default if possible. However, the performance and reliability of /dev/uinput is better so I can see why you might want to opt out of X11.

BrianHoldsworth commented 5 months ago

Understood. I took a look at build.rs and thought that, just for my purposes, it would work better to eliminate that build-time logic in favor of a feature flag instead. This mainly because I am cross-compiling. For cross-compiling, obviously the configuration of the host system is not what should control the configuration for the build.

indianakernick commented 5 months ago

I've pushed up something that I think should solve your problem. You can opt out of X11 with default-features = false. You can opt in without checking with the x11 feature.

BrianHoldsworth commented 5 months ago

Yes. This works good with my cross-compiling use-case. Thanks much!

indianakernick commented 5 months ago

Closing as resolved since version 0.7.0 has been published.