使用本地 OCR 引擎的 Linux 手写键盘。
This is program written for Linux desktop environment.
To recognize handwritten pattern program uses OCR engine.
At the moment program supports 2 OCR engines: Tesseract OCR and PaddleOCR.
To send the keyboard input program uses xdotool or ydotool.
You can find compiled .deb, .rpm and .AppImage packages in releases page.
This is the instruction for version 2.1. Instruction for version 2.0 is located at v2.0 branch of this repository. Instruction for version 1 is located at v1 branch of this repository.
Note: before using the program you need to install dependencies.
If program's window is in focus, before sending keyboard input program will trigger alt+Tab keypress to return focus to previous active window and only then send the input (this does not applied when '--skip-taskbar' option is set).
…Example of using command line options:
handwriting-keyboard-t --tessdata-dir=/home/user/ --lang=chi_sim -aIn this case (above), to recognize hand written pattern program will use Tesseract OCR (as default OCR engine) with training data from folder "/home/user/" and language "chi_sim" (Chinese simplified), particularly the file "/home/user/chi_sim.traineddata". Also in this case the program will automatically send request to tesseract-ocr after every stroke, because it was launched with "-a" option.
Install OCR engine: Tesseract OCR or/and PaddleOCR.
sudo apt install tesseract-ocrconda activate paddle_env
python -m pip install paddlepaddle==3.0.0rc1 -i https://www.paddlepaddle.org.cn/packages/stable/cpu/
pip install "paddleocr>=2.0.1"Install xdotool or/and ydotool.
sudo apt install xdotoolIf you use the program with Tesseract OCR, I would recommend to install tesseract 4 (instead of tesseract 5). Because the results is more accurate when using with tesseract 4 (at least for recognition of text (writing) in Chinese language).
If you use the program with Tesseract OCR, you also need to download model data for tesseract-ocr and copy .traineddata files to data folder of tesseract-ocr (for example for tesseract-ocr 4.0 it would be this folder /usr/share/tesseract-ocr/4.00/tessdata/). Or alternatively you can put these files in whatever folder you like and run program with --tessdata-dir command line option and point to the folder where model data files are located.
By default program uses Tesseract OCR with language set as chi_all, *.traineddata files for which you can download by this link.
PaddleOCR is significantly more accurate than Tesseract OCR, at least in regognizing Chinese characters, however it is also slower at least on my hardware.
If you use the program with PaddleOCR. PaddleOCR downloads model data at first use, then it can be used offline. List of available languages can be found by this link.
If you use the program with PaddleOCR and it is installed in conda environment, you need to activete conda environment first and then launch this program.
As for sending keyboard input:
This program (application) can work in Wayland desktop environment, however it is not fully supported.
Some specifics of using this program in Wayland:
Always on top property of the window can not be set programmatically. As workaround you can set it manually by right clicking on title bar of the window and checking 'Always on top' option (it should work, at least in gnome based desktop environment).
set_accept_focus(false) property of the window is not working in Wayland. Program's window will gain focus anyway (when interacting with it).
--skip-taskbar command line option will not work in Wayland.
--fly-to-bottom command line option will not position program's window correctly.
Xdotool does not support Wayland. For that reasoun I would recommend to use this program with ydotool instead.
If you use this program in Wayland desktop environment. I would recommed to launch it with --use-ydotool and --use-clipboard command line options.
Program written by using tauri framework https://tauri.app/
The script from https://github.com/ChenYuHo/handwriting.js is used to make a writing canvas.
To recognize handwritten pattern program uses Tesseract OCR or PaddleOCR.
To send keyboard input program uses xdotool or ydotool.
In order to run from code or compile the programm: You need to install Node.js 20 or newer version and Rust as well.
Install Node.js dependencies:
npm installRun program in development environment:
npm run tauri devRun program in development environment with cli (command line) options:
npm run tauri dev -- -- -- cli_optionsCompile the program:
npm run tauri buildThere is also version of this program using Google API or Digital ink recognition Server instead, it is available by this link: https://github.com/BigIskander/Handwriting-keyboard-for-Linux.
暂无开放 Issues,或尚未同步最近议题。