Skip to content
 
 

Repository files navigation

android-unistroke-keyboard

Unistroke Gestural Input Method for General Purpose and Command Line Use.

This provides an alternative to the Graffiti Pro app - which appears to no longer be maintained - and provides extensions useful for command line activities.

screenshot

screenshot

  • Left pane for alphabet.
  • Right pane for number.
  • Tap enters special key mode.
  • KEY button shows some useful key buttons.
  • Long press enters cursor mode. REMOVED

Please note that for reasons unclear, Microsoft Defender is marking the apk as malware. It is NOT and this is a false-positive. Scanning using multiple products at www.virustotal.com demonstrates that only Defender thinks this is the case. There is a good write-up on this problem here: https://medium.com/@smith_brendan/trojan-script-wacatac-b-ml-when-microsoft-defender-cries-wolf-usually-6fb25816eee6. I apologize for this and have tried, without success, to report the problem to Microsoft. There is nothing more I can do at this time.

Please note that the lion's share of the work here comes from the repo/author from which this has been forked. It is NOT intended to be a source of pull requests for the original.

Also note: Due to my lack of a modern build environment and the use of an older target SDK to avoid file access issues, there is no expectation this will build properly in a "modern" build environment without at least some modifications to those configs.

Changes from the original:

  1. Made input area taller for use with higher resolution screens (greater than 1920px in height) by increasing button height dimension from 36 to 60.

  2. Removed "cursor mode" entirely as it seemed to get triggered accidentally and caused much more trouble than it was worth.

  3. Added double-tap of Key button to show pop-up of the "cheat sheet".

  4. Some changes to the alphabet gestures - added to "y", "g", and "5" to make them more compatible with their Graffiti analogs. Changed them for "b" and "e" entirely due to frustrating, consistent mis-recognition.

  5. Removed various items related to notifications and other stuff that made it difficult to build inside of my old, Eclipse environment.

  6. Included the Gesture Builder apk since that is used to modify the raw resources in this app. (Note: this build of Gesture Builder is my own and differs slightly from the one included in the SDK. It has a test activity and the match prediction it displays should match that of the keyboard code). REMOVED in version 2+.

  7. Added Graffiti Return/Enter stroke to the common gesture list.

  8. Changed package id to avoid collisions as suggested here: tmatz#28 (comment)

  9. Added settings panel as launcher icon. Options include:

  • Log some information to the system logcat. You will need to use ADB or a logcat app to view this information.

  • Allow the app to read gestures from files of the appropriate names stored in the root of internal storage. This makes experimenting with gestures easier as no recompiling it required. However, it does require lowering the target SDK and addition of the READ_EXTERNAL_STORAGE permission. So Android may "warn" you. Results of this are shown in the app's logcat (if optionally enabled).

  • Show gesture recognition results/scores at the bottom of the input area.

  • Show "cheat sheet" excerpts as gesture input backgrounds.

  • Set minimum gesture recognition score. Recognition below this value is considered an error. Usually, a value of 1.5 is considered a good value and is the default. The accepted range is .5 to 3.0. Use after viewing prediction results, if needed. I personally prefer an error to a mis-recognition so I am currently setting this in the 1.8-2.0 range.

  • Perform extended vibrate on unrecognized gesture in order to make you more aware. If disabled, only a short vibration is issued. This also helps distinguish from the optional short vibration used when entering "special" mode.

  • Set minimum tap delay length needed to enter special mode. This should help avoid accident shift to this mode by stray touches.

  1. Slight enlargement of the size of the alphabet gesture area at the expense of the number gesture area.

  2. Added icon to replace the default one. Hopefully better but I am no artist :-(

  3. Changed position of "special" indicators from top/left to bottom/right as they seem more visible and do not obscure the "cheat sheet" backgrounds (when enabled). Optionally vibrate when entering "special" mode.

  4. Added support for the Graffiti Menu gesture to the common gesture list.

  5. Added pseudo-support for the Graffiti Shortcut gesture to the special gesture list. As this is a unistroke recognizer, I cannot implement the full Graffiti behavior as these require multi-strokes. As near as I could come was to optionally launch a settings-specified app upon recognition of the shortcut gesture. This could be a dictionary app, for example. I personally use a clipboard text expansion app which is fairly close to the original Graffiti shortcut function.

  6. Integrated the GestureBuilder app from original source code in SDK samples under the package name com.whitedavidp.unistroke_keyboard.gesturebuilder. This requires the change of the permission from READ_EXTERNAL_STORAGE to WRITE_EXTERNAL_STORAGE as the whole point of Gesture Builder is to write gestures to internal storage. It will place up to 4 files in your device's internal storage root folder: gestures_alphabet, gestures_number, gestures_special, and gestures_control if you decide to edit them from the information stored by default in the app's raw resources. You need only edit the file(s) in which you are interested. But once you do, you must be sure to enable the Load gestures from internal storage option and keep that enabled. Failure to do so will result in the app continuing to use the raw resources rather than your modifications. After editing, it is a important to press the Force Reload of Gestures button to ensure that your changes are put into use immediately. Prior to editing, the previous file will be kept in the same location with .bak appended as a backup. As a result, the Gesture Builder apk file that was previously included has been removed from the repo.

  7. In my seemingly un-ending quest to improve gesture recognition, I have incorporated the entire AOSP android.gesture package into this app under the name com.whitedavidp.unistroke_keyboard.gesture so I can fiddle with the recognition algorithms when I simply could not do so before. I already believe that changing the value passed to GestureLibrary.setOrientationStyle() from the "undocumented" value of 8 to 10 seems to make a difference. So I have made that the default and MAY, in the future, allow this to be set via an app option.

  8. Not really an addition. But I have spent a ton of time integrating and testing the results of a number of alternative gesture recognizers including $1, $p, 1cent, SiGeR, and the Lua version of $1. The sad result is that none of these produced better results than the built-in Android recognizer originally employed in this app. Some were much worse. So any hope of recognition improvements will have to come from either "fiddling" in some way with the original or perhaps incorporating a machine learning mechanism - which, I fear, will be too slow to prove useful in this application. So I will leave that to others.

gesture

About

Unistroke Handwriting Input Method for Programming

Resources

Stars

11 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages