-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactored injection #263
Refactored injection #263
Conversation
since there can be multiple evdev devices in the same grup it was possible to record keycodes even if the injection was active. This was confusing behaviour.
d4f389c
to
7ec8bc0
Compare
has still a bug where a forwarded key might not get released depending on the sequence of key releases
hopefully
this results in a better behaviour for overlapping combinations
reimplemented the macro function if_single()
D-Pad and joystick to button or key or macro mapping works now
mypy happieness
release any keys or buttons before the event pipeline shuts down
created beta branch |
@clausbertels (#7 (comment)) might have some ideas on how to improve the user interface :). See #263 (comment) and below for screenshots of the current state |
I just implemented the last back-end changes, this should now have the same functionality as the main branch plus some more. |
what happened to tests like |
Can't find |
I removed quite a few tests form the For example the various Those are things we no longer need to test specifically for the hold macro or even macros in general. The event-pipeline separates the Input handling from the actions a input triggers. Therefore we don't need to specifically test all the ways we can trigger a macro we only need to test all the different ways to trigger an action, whether this action is a macro or a key does not make a difference because the same system for input handling is used. There are test like As for the
So we don't actually need it, and I think there is at least There might still be tests I missed or other valid reasons I did not think of. So I am happy to add more tests where necessary. In general I try to keep the tests focused on specific behaviors and not write tests that test multiple (possibly unrelated) behaviors at once, that way they are hopefully easier to understand (shorter) and maintain. |
Thanks for explaining! as for for i in range(1, 20):
handle_keycode(_key_to_code, {}, InputEvent(*trigger, i), uinput) so it was testing various values, like when slowly pressing a trigger. I don't know why it was changed to |
Ah, because at some point the old should_map_event_as_btn function was taking care of setting the value of joystick/trigger events to 0 or 1. That means handle_keycode was actually receiving lots of events with the same value. |
New Features
EV_ABS
orEV_REL
to buttonsEV_ABS
orEV_REL
to buttons and other analog axisEV_ABS
event codes can be mapped to axis and or buttonsChanges
Consumer
classes with multipleMappingHandler
classesMapping
class toPreset
Mapping
class responsible for mapping a event or event combination to an output actionconfigs
directoryConsumerControl
toEventReader
evdev.InputEvent
objects with custominputremapper.InputEvent
objectsKey
class with aEventCombination
class of typeTuple[InputEvent]
TODO
Mapping
class into thePreset
Editor
-Part of the GUI interact with the newMapping
instead of thePreset
Mapping
objects for Joystick to MouseInjector._grab_device
to purely rely on mappings, no longer usemaps_joystick()
Mapping
in the preset filesmapping_parser
Future (probably not this PR)
RelToAbsHandler
RelToRelHandler
AbsToAbsHandler