Skip to content
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

Allow loading arbitrary python modules #46

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Lillecarl
Copy link

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:

  • Create some kind of base class to inherit and override functions in for imports rather than "function pointers"
  • Make code nice
  • Add something to the build system that generates ".pyi" files for all keys and shit in evdev lib
  • Docs

Note: I'm very much still learning Python so don't be afraid to suggest anything and everything.

Implements support for loading arbitrary python modules and calling
functions on them when events fire.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant