obv-mikhail / InputBot

Rust library for creating global hotkeys, and simulating inputs
MIT License
400 stars 72 forks source link

Enable `stop_handling_input_events` on both platforms and make auto stop optional #92

Closed alexmadeathing closed 8 months ago

alexmadeathing commented 10 months ago

This PR builds upon #90, further enhancing exit comprehension by giving the user the option to choose between auto stopping when no binds are present (the old windows/linux behaviour) and stopping only upon explicit call to stop_handling_input_events (previously a linux only feature). The stop_handling_input_events function is now available to both platforms.

Warning !!! Only compiled and tested on windows.

Migration Guide

Motivation

I should mention the main motivation for this.

The obvious motivation is to make stop_handling_input_events available across platforms.

But secondly, I'm working on an app which may at some point have zero binds present. I don't want the input handler to exit every time the user removes binds. Therefore, I added the option to set auto_stop behaviour.

Now that I think on it, perhaps I should split this PR into two... Thoughts?

Changes