krmanik / Anki-xiehanzi

Learn, read, write and practice Mandarin by drawing strokes in Anki Desktop, AnkiDroid and AnkiMobile with audio of HSK 2.0 (HSK1-6) and HSK 3.0 (HSK 1-9) characters.
https://krmanik.github.io/Anki-xiehanzi
Other
157 stars 17 forks source link

graphic tablet support for drawing #13

Closed camerooncameroon closed 1 year ago

camerooncameroon commented 2 years ago

Hi! Thanks again for your great decks! (btw back to our past conversation I'm almost there with dictionary deck based on your notetype, hope to share it soon)

I tried to draw hanzi using graphic tablet but the results were bad - I could only make a very short lines which weren't enough to be recognized (drawing in Paint etc is fine). I also tried all the possible sensitivity settings on the tablet to no avail.

I think on desktop, tablets are very handy way to practice drawing hanzis' strokes (which is one of your decks' great features).

Perhaps it's possible to adjust query intervals or otherwise make the Javascript not to give up getting data from the (unfinished yet) stroke?

I'm also attaching some videos to clarify the issue:

https://user-images.githubusercontent.com/78047188/147406160-c50ed49a-c6a6-4e08-9d8d-61c96cb2753b.mp4

https://user-images.githubusercontent.com/78047188/147406162-0b9b40e9-db8e-4545-9fab-0dd71092f53a.mp4

https://user-images.githubusercontent.com/78047188/147406163-4368ec00-c38b-4bbb-8b7d-e4d70c536566.mp4

krmanik commented 2 years ago

So, it only create problem on Tablet. Can you share the card template for testing? Or it is similar to my deck? What is device model on which AnkiDroid running?

Try it to test. Put this in iframe in a new test deck, then check if it is smooth or not?

<iframe src="https://hanziwriter.org/demo.html" width="100%" height="300"></iframe>
camerooncameroon commented 2 years ago

So, it only create problem on Tablet.

Exactly, drawing on desktop with mouse and on ankidroid with stylus is working fine. Only when I try to use the external graphic tablet on my PC instead of mouse (which is not very handy to draw with) then those short lines are produced. I use Samsung Note 4 as graphic tablet with virtual tablet server app (both on PC and Android), which work together just great in other graphic apps.

Can you share the card template for testing? Or it is similar to my deck? What is device model on which AnkiDroid running?

I use your notetype and card templates from the HSK 3.0 deck for they're cool )) Ankidroid is running on the Samsung note 4 Android 6.0.1 (and drawing here with a stylus or a finger works fine).

Try it to test. Put this in iframe in a new test deck, then check if it is smooth or not?

Tried and got same results - only short lines are drawn in Anki Desktop (with the stylus via external graphic tablet) not enough to be recognized as a stroke. The mouse action is ok. So that's the Hanzi Writer template specifics I guess?

camerooncameroon commented 2 years ago

I was setting the power options on my windows PC and I found some interesting section in the advanced menu:

it mentions Javascript timings changing in the Internet Explorer.

Hence Java has some timers used in it, perhaps xie Hanzi's javascript is set to a low interval timings (e.g. to lower power consumption), perhaps if they set these timings to a higher level, it won't lose input from the graphic tablet?

krmanik commented 2 years ago

Hi, I think it needs more detailed debugging of the issues. It may be not related to hanziwriter. Also, it is hard to debug without having the devices. But I will try to further check the issues.

The power options seems to be interesting. But I have no idea about this. The deck is accessed via vncserver but the paint seems work fine. Also when it accessed in Anki it creates problem. So, I may request to ask the same question on https://forums.ankiweb.net , somebody may have the idea about the issues.

In mean time I will try to debug issues.

camerooncameroon commented 2 years ago

Thanks for your time spent on reading and thinking on this specific issue! Actually the good point is that this device can be itself reproduced as it is an app which installs on any Android. Here's the link: https://www.sunnysidesoft.com. But as I found, it is only usable on Samsung Note and its likes with the stylus pens. Perhaps you happen to have one of such devices...

krmanik commented 2 years ago

Hi, I have checked the app, and it compatible to my devices. But I will update later, because I also finding the actual issues.

camerooncameroon commented 2 years ago

Hi, that's great news, thank you! Forgot to mention, this app has two modes: native (for devices with stylus) and compatibility (for any touch device). I had issues with the first mode (native) on Samsung Note 4 which ships with a stylus. Which mode/device did you try? The compatibility mode is rather uncomfortable to use, I didn't even get how to use it ))

camerooncameroon commented 1 year ago

The issue is on js (server's) and/or app's (Virtual tablet) side so no sense to keep it here