Allow loading arbitrary python modules #46
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In this PR's current state I'm mainly gauging for interest in this feature, I'm maintaining my own remapper script right now (which I would still would do, but as an evdevremapkeys module instead).
Implements support for loading arbitrary python modules and calling functions on them when events fire.
Definitely don't merge this, it's very much just a WIP POC.
So what this does is allows you to configure a folder where we look for files, import them and add functions as "event hooks" so anyone who knows a little bit of Python can extend the functionality as they wish, limiting the scope of evdevremapkeys to a reasonable level while allowing "me" to do stuff like this monster
Ideas:
Implement some common "event modules" for things like when capslock is held it's mapped to ctrl, when capslock is pressed quickly we send an escape key and allow these to be toggled per device ("Core evdevremapkeys modules" kinda)
TODO:
Note: I'm very much still learning Python so don't be afraid to suggest anything and everything.