Giter Site home page Giter Site logo

saren-arterius / google-chinese-handwriting-ime Goto Github PK

View Code? Open in Web Editor NEW
84.0 6.0 9.0 406 KB

Written in Electron for Linux.

Home Page: https://aur.archlinux.org/packages/google-chinese-handwriting-ime/

License: Creative Commons Zero v1.0 Universal

HTML 1.76% JavaScript 89.48% Python 8.76%
touchpad linux-desktop chinese-handwriting-imes under attack by google

google-chinese-handwriting-ime's Introduction

Google Chinese Handwriting IME

A Chinese IME that works by exploiting Google Translate using Electron. This application aims to solve my friend's Chinese input problem when using Linux desktop. Therefore, this application is for Linux desktops only.

MacOS-style laptop touchpad input support is recently added.

Why?

  • Google input tool works only inside Chrom{e, ium}
  • My friend said that all Chinese handwriting IMEs in Linux suck, and I promised to my friend that I will make this for him
  • I could do a better touchpad support that benefits laptop users.

Installation

  1. Ensure xdotool, python3, gconf and latest node and yarn installed.
  • For touchpad support, evtest and xorg-xinput are also required.
  • Ensure that you are using X instead of Wayland.
  1. $ git clone https://github.com/Saren-Arterius/google-chinese-handwriting-ime.git && cd google-chinese-handwriting-ime
  2. $ yarn
  3. # pip3 install pyperclip or equivalent package from your distro.
  4. # usermod -a -G input $(whoami)

Config for touchpad

  1. Open config.js with your text editor
  2. Run $ evtest, select your touchpad. Now touch your touchpad and move your finger to right bottom, observe the maximum ABS_X and ABS_Y value between the flashing messages.
  • Change touchpad_support.touchpad_coords.max.x and touchpad_support.touchpad_coords.max.y to the values you observed.
  • Repeat for minimum ABS_X and ABS_Y and apply to touchpad_support.touchpad_coords.min.x touchpad_support.touchpad_coords.min.y for the left top corner.
  1. If the cursor went outside of the drawing area when writing, or if there is too much padding, adjust the config above and find the best values.
  2. If your touchpad is not autodetected, run $ xinput list and $ evtest to find corresponding device IDs for your touchpad. Optionally you may add a new entry into device_blacklist to avoid interference.

Running

  1. $ cd google-chinese-handwriting-ime
  2. $ yarn start

Screenshot

Screenshot

See it in action

Known problems

  • No wayland support!
  • xdotool type reliability and performance
    • Slow performance on GNOME
    • Some text input maybe missing
  • use_clipboard could work better for GNOME and more reliable, but it may not work on some applications
    • The use of clipboard hack may make the text input unresponsive if you copied an image to clipboard
    • If the image inside clipboard is no longer needed, copy some text to clean the clipboard before text input
  • For KDE Plasma, need to set "Focus Stealing Prevention" to "none" steal prevention

Tested on

  • XPS 9360
    • Arch Linux
    • KDE Plasma 5.14 / GNOME 3.30
  • Fujishu SH572
    • Arch Linux
    • KDE Plasma 5.14

Terms

This application is licensed under Creative Commons Zero v1.0 Universal which is basically a "do whatever you want" license. Google Translate itself is covered by Google Terms of Service and Provacy Policies.

google-chinese-handwriting-ime's People

Contributors

appins avatar auchenberg avatar bhaveshgohel avatar bokuweb avatar bratsos avatar clemens-tolboom avatar fscherwi avatar galeksandrp avatar haacked avatar icodeforbananas avatar icoxfog417 avatar ionicabizau avatar izuzak avatar jlord avatar kamikazow avatar kevinsawicki avatar laiso avatar louis993546 avatar phanect avatar posva avatar pratu16x7 avatar sahildua2305 avatar saren-arterius avatar steevedroz avatar tcyrus avatar thompsonemerson avatar zanesterling avatar zeke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

google-chinese-handwriting-ime's Issues

Any support for Japanese?

I really like this method of writing to practice writing of kanji, but some characters are different between Chinese and Japanese. Are you considering adding support for Japanese?

Unable to paste written words to any program

Just newly installed Debian 10 and as soon as possible tried to install the Google-Chinese Writing-ime. The program shows up OK, and can recognize my handwriting, but it seems unable to paste any words I had written in it to any program, like firefox, libreoffice.

In config.js , I alter the line use_clipboard: true

I am using Debian 10 with GNOME 3.30.2

Screenshot from 2019-08-08 01-44-47
Screenshot from 2019-08-08 01-45-05

When the focus is on the program, the words just disappear after I pressed the blue button or press Enter on the keyboard. Not sure where the words go.

a different window

I've just installed it. Btw, it seems that "npm install" requires sudo too. Anyway, after starting it I get a window, which is a bit different from yours... Inside a Google translator page, I can only input characters from the keyboard. I'm on kde plasma, ubuntu 17.10
Or maybe I didn't get well how it works...
snapshot1

Installation fails on yarn command

I am running Ubuntu 18.10 on my 15" macbook pro late 2013, and I followed the instructions in README.md

At step 3:

$ yarn

I got this error:

00h00m00s 0/0: : ERROR: There are no scenarios; must have at least one.

so how can we solve this problem?

app not working

when I load window, the webpage keep reloading iteself, toggling "is_input_active" attribute in webpage

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.