Skip to content

Rytisgit/Anki-StylusDraw

 
 

Repository files navigation

Anki-StylusDraw

Initially based on the Anki-TouchScreen addon, updated ui and added pressure pen/stylus capabilities, perfect freehand(line smoothing) and calligrapher functionality.

Website to test the drawing functionality: https://rytisgit.github.io/Anki-StylusDraw/

Draw Demonstration

Changes

  • Added background color selection
  • Added follow screen mode(menu option) and small canvas mode(alt + b) to increase drawing speed on very big cards
  • Added toolbar location configuration and other small fixes.
  • Fixed "resize not defined" error. Thanks huandney.
  • Updated UI, add option to convert dots, hide cursor and ui while drawing. Thanks rin-w
  • Added Perfect Freehand mode(https://github.com/steveruizok/perfect-freehand)
  • Added Calligrapher mode(https://github.com/atomanyih/Calligrapher)
  • Added pressure sensitivity
  • Increased drawing speed
  • Added , for showing/hiding, . for clearing, alt + c for calligrapher mode and alt + x for perfect freehand mode
  • Added standalone website to test drawing
  • Work around a Windows Pen bug which makes 2 primary pointers appear when drawing in Anki

Hardware

Tested to work with a Huion H1161, Windows Pen enabled.

For best experience:

  • don't use software rendering(enable hardware acceleration)

  • turn on use pen as a mouse with Windows Pen

  • if drawing is slow on big cards turn on follow mode or small canvas

https://docs.ankiweb.net/platform/windows/display-issues.html

Run echo auto > %APPDATA%\Anki2\gldriver6 in cmd for Qt6

Switch away from Software in Qt6

Qt5 rendering change Switch away from Software in Qt5 Check use pen as mouse in Windows pen settings

Turn On Follow when scrolling or small canvas if drawing is slow on very big cards

Old Description

Implements same drawing/writing mechanism as in AnkiDroid. Your writing is NOT intended to remain on the cards after review - same as in AnkiDroid.

Use the menu ViewTouchScreen to activate/change settings.

Use Ctrl + R to toggle the touchscreen.

Use icons which will show up in the top right corner of the review screen to temporarily hide/clean the board. Enjoy!

Warning: the version for Anki 2.0 has limited functionality, and may sometimes not work as expected; since the release of Anki 2.1, the old version is not supported.

Changelog:

  • 0.2.6 - make "undo" action available under Alt + Z
  • 0.2.4 - add support for enhanced image occlusion, add a fix for "a double click bug" by LaucianK
  • 0.2.3 - bug fix release, improvements to undo button, styling and performance
  • 0.2.1 - minor fix for the buttons/canvas positioning
  • 0.2 - added "undo" option, improved the support of long cards plus other minor improvements

Disclaimer

Important parts of Javascript code were inspired by creativejs tutorial. I recommend you check out the resource if you are interested in learning JS.

This add-on works well with Anki Night Mode.

For developers

You are more than welcome to contribute! While I may not be able to support every user of this addon, I will do my best to help any developer willing to open PR implementing new features or fixing bugs.