krassowski / Anki-TouchScreen

Touchscreen functionality for Anki
https://ankiweb.net/shared/info/1631622775
GNU General Public License v3.0
25 stars 13 forks source link

Windows Pen #2

Open Ketsujiji opened 6 years ago

Ketsujiji commented 6 years ago

No support for Windows pen when using Surface products, have to keep button pressed and there is a small lag.

fishnibble commented 5 years ago

I saw the repo owner does not have own a windows pen. I own one and am willing to help out with what i can. I'm not familiar with the libraries that are out there that support the pen with python. @Ketsujiji Could you give me some ideas about what you've looked at so far?

krassowski commented 5 years ago

I think that PointerEvent API might be of some use, though I have not tried it.

alaskakw commented 5 years ago

@krassowski is a windows pen all you need? If it'd speed up the resolution of this problem, I'd be willing to buy one off ebay and have it shipped to you. Needless to say if you also need a surface, I wouldn't be able to help with that.

krassowski commented 5 years ago

No, I would need someone to rent the device or (much-preferred option) I would need someone to point me towards a way to set-up a virtual machine to test this issue. I did not find anything with a quick search, but I am not working with development for Windows and may miss keywords.

I know that Microsoft did such a thing back then when they introduced Edge - they released special VM images for developers to allow them to support their (back then) new browser.

krassowski commented 5 years ago

Or if someone is willing to try, I could guide them with some hints about how to implement this stuff.

fishnibble commented 5 years ago

I have a pen and a Windows Machine to support it

krassowski commented 5 years ago

Would you be able to test if this simple substitute of API to PointerEvents works?

Simply replace contents of the __init__.py file with the this. You can locate the file from Anki menu choosing Tools -> Add-ons -> select touchscreen addon -> View Files button; please remember to restart Anki afterwards. Please let me know if it works for you.

Ketsujiji commented 5 years ago

I lost my account for github for a while, I tested the add-on and it registers the pen. will use it for a while to see how well it works

AnthonyCouthures commented 4 years ago

Hello here,

I have the solution, this "bug" is due to the windows pen itself. In fact, it generates a lot more position data than a usual mouse and maybe other pen.

I put the code below I use now and it seem to work well with my windows pen. This way I can choose the "step" of drawing for mor fluency.

https://github.com/AnthonyCouthures/Touchscreen-Anki/blob/master/__init__.py