Skip to content

Conversation

@NicoM1
Copy link

@NicoM1 NicoM1 commented Feb 22, 2025

Hello!

I'm hoping for easy access to pressure-sensitivity on Windows, so I spent a little bit of time refactoring #90

Thanks to @aklevans for doing all the real work in that PR.

Changes:

  • Remove some unused constants, link to Windows documentation where constants come from
  • Remove automatic monitor selection (could be a separate PR)
  • Clean up some naming to use snake_case
  • Pull pen device creation + event sending into a class to be more like libevdev
  • Use sys.platform to check OS type (windows/linux) instead of requiring separate args
  • Add "--pressure" argument and deprecate "--evdev" (since detection is automatic and evdev is not used on windows)
  • Flip tilt direction as https://patrickhlauke.github.io/touch/pen-tracker/ showed the wrong pen orientation

Note that I'm much more of a C++ programmer than a python one, so I tried to generally follow the style in this repo but there may still be refactors desired to fit in better. Happy to do small things so this can be merged into main though.

Important:

  • Did not test on linux, someone with access should verify that the platform detection works correctly with --evdev or --pressure
  • Did not test tilt direction on linux, someone should verify that https://patrickhlauke.github.io/touch/pen-tracker/ shows the correct orientation (Windows now shows correctly)

…lso add platform detection so that --pressure supports windows or linux
@NicoM1
Copy link
Author

NicoM1 commented Feb 22, 2025

Note that this coincidentally seems to fix #79 so maybe it should just be the default mode on Windows.

@Evidlo
Copy link
Owner

Evidlo commented Feb 23, 2025

Thanks for the contribution! There are some minor changes to the architecture on the master branch that changed recently.

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.

3 participants