feat: support for xiaomi smart pen #1132
Open
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.
First of all I would like to thank you for this amazing project. Its perfect for my purpose. My only concern was that my Pen for Xiaomi Pad 6 wasn't supported. I took a look around the code base to implement support for the pen. Seems like you already have support for keyboard and since Xiaomi pen keys works as Page Up and Down, I have updated a few things to support the pen.
Changes made:
PageUp
to toggle colors andPageDown
to toggle eraser.About the workaround:
For some reason, keybinds only works after virtual keyboard is opened at least once. I am currently fixing this by doing this:
To be fair I am not too experienced in flutter but I tried various ways but none seemed to work. You might know better way to handle this. Let me know what to change to fix that if you have ideas. But this workaround has been perfectly working for me and keyboard doesn't even show up since show and hide happen one after another.