HowToInputMethod770

This page will be a work-in-progress for quite some time, so be patient. When ready I'll remove this warning.

MoinMoinWiki Macro: TableOfContents

Using the Input Method

Basics

The Nokia 770 comes with two different input methods. One is the Virtual Keyboard (VKB) and the other the Handwriting Recognition (HWR). Each of them is different concept of letting the user to enter text using the touchscreen of the device. N770 doesn't have any hardware keyboard and the touchscreen the the only mean normal user can use to enter text.

The input method framework on 770 is there to do help user. It takes care of the basic cases where user enters text. It will show the input method when user focuses some text entry in anticipation of text being written or editted. And when the text entry loses focus it will hide the input method as there is no need for it to occupy space on screen. The framework also handles input modes. Some text entries expect specific data, like numbers or text, and they can use the framework to communicate this to the input method, which will then try to switch to the mode best suitable for the task, as for example showing the layout with numbers in numeric mode on the VKB or switching the handwriting to numeric mode.

Common controls

All input methods share the common controls interface. Each has the control buttons on the right and the left, and most of them are same in every input method: * hide button, located bottom-right. It will hide the keyboard instantly if its presense is not welcome anymore. * special characters button, located second from bottom right. It will show the Special Characters view. * enter button, located second from top right. It works like normal enter. * backspace button, located top-right. It works just like normal backspace. * tab button, located top-left. It works just like normal tab. * menu button, located bottom-left. It will show the menu of the input method.

The point of common controls is that they provide the basic controls for every input method on the same place.

Input method menu

The input method menu pops-up when user clicks the menu button (bottom-left). The menu has entries for : * usual edit functions (Cut, Copy, Paste). Really usefull when one wants to copy/paste text from/to some modal dialog when application's menu is not accesible. * input method switching. Gives choice between the virtual keyboard and the handwriting. * language switching * tools menu, with the Handwriting teacher, settings and help Some items are dulicate. User can launch the Handwritting teacher also from Text Input Settings applet in Control pannel, which is the same as the "Settings" item. Also the Edit fucntions are most of the time available from both the application's menu and input method's menu. The help is context sensitive and will pop-up the help page for Input Menthod, which is not as comprehensive as this is going to be;-)

Languages

We have a primary and secondary input method language. The "Language" menu item might be dimmed, in the case the secondary language is set to "empty", i.e. not used, and therefore there is not point switching to it, right?

Launch the Text Input Settings from Control pannel or the "Settings" from the Tools menu of the input method. Pick the primary and secondary input language (note: not UI language) and then you can switch between them in the menu of input method fast, when need.

Please note that the Settings applet has another tab, where one can set the word completion for the primary language. The word completion for secodnary language comes automatically.

Virtual keyboard

This is the "on-screen" keyboard representation. Shows an image of a keyboard, user taps the keys, and they get entered. Simple. But it does more. It has the uppercase and lowercase layouts. Tap the CapsLock button (secont from top left) or the Shift button (second from bottom left) and it switches between upper and lowercase. It has accent keys too (only on some keyboards), that allow you to write accented characters if they are not already present in the layout. If some character is not to be found in any layout, try the Special Characters view.

There is a word prediction located on the bottom of the virtual keyboard next to the space (if activated from Settings). More will be said about it in separate chapter. To make typing on the VKB faster it does support several gestures.

Gestures

Gesture is a movement of stylus over the virtual keyboard when the stylus is down. Currently is supports following gestures: * space gesture: tap and hold stylus, move it horizontaly right. This will enter a space as soon as the stylus moves far enough horizontally right. * return gesture: tap and hold stylus, move it vertically down and then release. Upon release it will enter a return, e.g. go to next line or to next text entry. * alternative case gesture: tap and hold stylus on top of some character on VKB, move it vertically up and then release. Upon release it will enter alternative case of the character on which this gesture was performed. If the VKB was in lowercase, then the uppercase of the character will get entered and vice versa. * multiple backspace gesture: tap and hold stylus, move it horizontaly left, then back right, then back left, .... This will delete one character on every direction change. I.e. repeat this zig-zag movement 10 times and 10 characters will get deleted.

Handwriting recognition

Handwriting tries to convert user-inked characters to recognized letters. Switch the input method to "Handwriting" in the input method's menu to try it out. Note the handwriting does not have any CapsLock or Shift buttons, but different ones. Second from top left is the input mode button, which switches between the alphanumeric and punctuation modes. Below (showed only when needed) is the ChangeCase button, that will chage the case of the recognized character.

Cleaning the handwriting area

The handwriting area has a baseline on which the characters are written and you can start anywhere, left or the middle. After inking the recognized characters will appear. As more and more characters take up the handwriting area there will appear a colored area on the left. Write into it (over the already recognized characters) and it will not only recognize the newly inked characters but also enter a space and clean the handwriting area.

Connecting long lines or words

But what if you have already used all the handwriting area and your last word didn't fit there? As you near the end of the baseline, the recognized text will gray out, and another colored area will appear on the very right. Just continue inking your next characters from left over the grayed-out recognized text. This will clean the handwriting area and keep adding your characters to the last recognized word.

Fixing typos

The biggest enemy of the handwriting are typos, or misrecognized characters. Users hate going back to delete and re-type the wrongly recognized character. To remedy this somehow we have the replace-in-place function. Ink some text and wait till it gets recognized. If you would like to modify any of the recognized characters, just type over it a new one, it will get recognized and replaces the original one.

Inserting space to words

Quite often two inked characters get recognized as one and thus the recognized word is missing a character. User doesn't want to move the cursor to the place and insert the missing character. Instead just draw long horizontal line from the place the character is missing to the end of the word. This will add a space at the place (somewhere in the midle of the recognized word) and you can insert the missing character there.

Changing the case of recognized character

You can change the case of the last recognized character. We have the alternative case button for it. Just ink a character, wait till it gets recognized and then the alternative case button appears. Click it and the case of the last recognized character changes.

Deleting recognized characters

So you have inked characters and they got recognized in the handwriting area. If you want to delete some or all of them, just draw a horizontal line from right to left (as a backspace gesture) over the characters you want to delete. This will remove them and re-shuffle the remaining recognized characters in the handwriting area.

Handwriting teacher

The handwriting models shipping with the device do not suite everyone. To get some better recognition rate use the handwritting teacher. It is also excellent on explaining how to ink certain tricky characters (e.g. dash).

The Teacher can be launched from the Text Input Settings applet in Control Panel. Shorted way is by selecting "Teacher" from the "Tools" menu of the input method.

Learning how to write a character

The Teacher is good at explaining how does the engine expect you to ink certain character. Ever wondered how to ink e.g. coma, zero or capital O? Launch the Teacher, select the input type (Letters and numbers or Special Characters), then the language group (Western, Greek or Cyrilic). The Teacher will show a list of available characters on the left, pick the one you are interested in and it will display available drawing patterns in the middle. Tap on any of those patterns and the Teacher will animate the way this one should be inked to get recognized by the engine.

Teaching user patterns

The Teacher lets you also to add your own character writing pattern. Launch the Teacher, either from the Text Input Settings in Control panel or from the Tools menu in the input method. Select the input mode and language group. Find the character you want to teach in the list on the left. When you click it, the pre-defined patterns show in the middle. On the bottom is a writing area for the user pattern.

Just write your pattern there. The engine will check that your pattern doesn't collide with some other pattern, either predefined or user-defined. If everything checks alright, the newly entered user pattern is stored and immediately available for the recognition and a small icon appers next to it in the list of characters on the left. User-patterns can be removed at any moment, one by one, by tapping on the "Clear" button next to the user pattern.

Teaching shortcuts

Shortcuts are bit advanced thing. Imagine you would like to get your drawing recognized as a word, or a whole sentence? No problem, launch the Teacher and switch the input mode to "Shortcuts". Now select one of the showrtcuts in the list on the left (they should all be ). The Shortcut text () appears in the middle. Tap the "Edit" button next to it and enter some frequently used word, phrase or even a sentence (e.g. "With kind regards" or "Have a nice day" to the phrase dialog that pops-up and tap the Accept button.

Now ink the shortcut itself into the drawing area bottom right. There is a limit to the number of strokes, so make a good pick. When your inked shortcut gets accepted, the shortcut is ready to be used.

Special characters view

The Special characters view (SCV) is present in both the Handwriting and the Virtual keyboard. It is invoked by tapping the SCV common button, located second from bottom right. The SCV shows four tabs with Common, Symbols, Accents a-m, Accents m-z offering what it says, all kinds of accents and symbols. The SCV supports case shifting with the common Shift button.

The Special characters view hides itself immediately after the user tapped one character and automatically returns to the previous input method (VKB or HWR). To pick another character from SCV just open the SCV again.

Text Input Settings applet

In the control panel is the Text Input settings applet. It has options for all the possible input method settings located on two tabs. On the first - General - tab there are: * "Input method" - the current (or prefered) input method. Which input method launches next time user focuses any text widget. * "First language" - the primary language of the input method. Best visible in the virtual keyboard, where it affects the layouts. In handwriting it is rather invisible but functionally it sets the recognition engine. * "Second language" - this one can be empty in case if user doesn't use second language. You can switch between the first and secon language from input method's menu. * "Character recognition time" - this is basically the timeout after which the recognition of inked charaters occurs. * "Capitalize" - turns on/off the auto-capitalization. Starts sentences with capital letters, then goes to lowercase. * "Handwriting case correction" - turns on/off the automatic case checking for handwriting recognition. If the setting is on, after recognizing two lowercase characters in a word recognizes the remaining characters inside the same word automatically as lower case. The second tab has the following settings: * "Word completion" - shows/hides the word completion. * "Dictionary" - this is bit tricky one. This sets the word prediction dictionary for the first (primary) language only. The seconds language sets its dictionary automatically to the same as the language is. The reason for this could be that you might want to use e.g. english keyboard layout even though you would like to get your word prediction in e.g. Finnish. Then you would set the first language to English (UK) and the Dictionary to Suomi (Suomi). * "Minimum characters required" - this one relates to the word prediction. How many characters you have to type/ink before the word prediction offers candidates. * Insert space after word" - this one relates to the word prediction too. If you choose a word from the word prediction woudl you like to have a space automatically added after it or no?

There are the usual OK and Cancel buttons in the settings dialog and also the "Teach" button, that launches the Handwriting Teacher. You probably noticed the question mark icon in the top-right corner of the applet. Tap it and you will get help about it. Though it is not too extensive.

Word prediction

The word prediction we mentioned few times before. The prediction is located on the bottom of our input methods, next to the space-bar on the VKB and under the handwriting area in the HWR. One can turn it on/off from the Text Input setting control pannel applet.

The word prediction offers up to four word candidates based on the already typed/inked characters. After it got enough characters (how many is setup in the applet too), it will show the candidates. For example typing "no" in English (UK) input language and it would give you candidates "nothing", "normal", "nobody" and "noble". Add "k" to it and the candidate list shrinks down to "nokia".

All the parts of the word prediction are interactive. Tap on the prefix, e.g. "no" and characters "no", that are already written will get a space and the word completion cleans up.

Tap normally on any of the candidates, e.g. "noble". The characters "no" that we already entered will be complemented by the "ble" to make the entered text "noble ". At this moment the word completion cleans up too. Another interesting thing has hapened in the background. The word "noble" has been marked as the prefered one, and next time you type "no", the candidate list should be ordered as "noble", "nothing", "normal" and "nobody". This way the word prediction tries to always provide the most relevant candidates.

User dictionaries

The word prediction contains also user dictionaries. Try typing "ub" in the English (UK) language. There should not be any candidates. Finish typing the word as "ubuntu" and put a space after it. At this moment the word prediction scaned your word, figured out it doesn't have this one and saves it automatically to user's dictionary. This way it complements the factory shipped dictionaries with user created ones. Next time you type "ub" there shall be the word "ubuntu" as a candidate ready for you. Note that user dictionaries are also related to the input language in use, i.e. one for each language.

Removing unwanted candidates

But what if one of the provided candidates is not welcome or is annoying? There is a way to blacklist it and thus prevent it from being shown again. For example, you really hate word "politician" being shown in English (UK) after you type "polit". So after typing "polit", the word prediction will list candidates "political", "politics" and "politician". Now tap and hold the candidate "politician" until a context-sensitive menu appears. It offers "Insert politician" and "Remove word" choices. Pick the "remove word" and the word "politician" just got banned from the word prediction. Congratulation, no more "politician" candidate after typing "polit".

This blacklisting is unreversible for end-user, so think twice before blacklisting too many words;-) It does not prevent you from typing such words, it just prevent them from being ofered as word prediction candidates.

Note: One could potentially remove the blacklist fiddling with or removing the /home/user/.osso/hildon-input-method/.custom.blacklist.dictionary file. It is untested, though!

External input devices

Coding for the Input Method

See InputMethod for some notes (these pages should probably be merged). Example code can also be found in the code snippet library of the Maemo Garage: https://garage.maemo.org/snippet/browse.php?by=lang&lang=2