GP2X Text Entry Idea + Prototype App


noir.pl

Still Fresh
Joined
Oct 24, 2005
Messages
21
Age
42
Website
Visit site
I've just had an idea about text entry on gp2x.
Forgive me that the description will be very brief but it's 02:30 and I'm tired.

Here it is:
* joystick selects character bank (central bank accessed via joystick push)
* "ABXY" keys insert letters
* "L" key exits text entry
* "R" key inserts most probable letter (based on dictionary)

Below you will find small app in python (requires TK) to test this idea on PC.
Feel free to change the config section and experiment with different layouts...
hell... feel free to do anything with this code :)

BTW. Functionality of "R" key is not yet implemented... I'll do this later tomo^H^Hday.

Code:
#!/usr/bin/python

# gp2x text entry prototype v1
# by noir.pl -> mobarski AT gmail DOT com

#=======================================================================
# config
bank_keys = "qweasdzxc"
char_keys = "1235"
bank_text = (
    "    ", "abc ", "def ",
    "ghi ", "jkl ", "mno ",
    "pqrs", "tuv ", "wxyz",
)
#=======================================================================

from Tkinter import *
import sys

root = Tk()
info = []
active_bank = 0

root.unbind_class("Text", "<Return>")
root.unbind_class("Text", "<Any-KeyPress>")
root.unbind_class("Text", "<Any-KeyRelease>")

text = Text(root, width=40, height=20)
text.grid(columnspan=9)

def select_bank(bank):
    global active_bank, info
    info[active_bank].tag_config("all", foreground="black")
    info[bank].tag_config("all", foreground="red")
    active_bank = bank

def on_bank_key(char):
    bank = bank_keys.find(char)
    select_bank(bank)

def on_char_key(char):
    i = char_keys.find(char)
    c = bank_text[active_bank][i]
    text.insert(END, c)
    sys.stdout.write(c)

def on_key(event):
    k = event.char
    if k in bank_keys:
        on_bank_key(k)
    elif k in char_keys:
        on_char_key(k)

def create_info():
    global info
    i = 0
    for b in bank_text:
        t = Text(root, width=3, height=2)
        info += [t]
        t.grid(row=1+i/3, column=3+i%3)
        tags = ("bank%d"%i,"all")
        t.insert(END, " %s "   % b[3], tags)
        t.insert(END, "%s%s%s" % (b[0], b[1], b[2]), tags)
        i += 1

create_info()
select_bank(4)

text.insert(END, "select bank with keys: " + bank_keys + "\n")
text.insert(END, "enter text with keys: " + char_keys + " from num pad\n\n\n")

text.bind("<Key>", on_key)
text.focus_set()
root.mainloop()
 
There are many of these sorts of systems out there (most patented :/), so maybe do some research to see which are the faster ones etc. Theres some where you do 'shifting' .. joy-left + a == some key, while joy-right+a == some othe rkey, etc; given 4 buttons and a joystick, you can do ever character in like 2 or 3 things.. joy+key etc. or somesuch..

jeff
 
It would be nice to have a keyboard library available.
The way you describe it is what I thought of too, it makes sense.
I'd help with it if you needed.
Although slight modification you can use 8 directions for the 8 banks and have a key for the 'special' chars. Save counter-intuitive to press a button for a bank and directions for others
 
New version of my app can be downloaded from here:
http://rapidshare.de/files/6885821/text12.py.html

Changes:
* dictionary based next letter hint (insert this letter with "6" from num pad)
* dictionary of ~150 most common words (according to ISBN 0582-32007-0)

To run this app under windows you must install Python environment:
http://www.python.org/ftp/python/2.4.2/python-2.4.2.msi (10MB)
Linux folks will know what to do.

There are many of these sorts of systems out there (most patented :/)
I know :/ I'm trying to create something new, but it doesn't mean that this will not accidentally infringe some patent :(

so maybe do some research to see which are the faster ones etc
Still doing it... but to be honest I don't belive in most given numbers - it's either marketing crap or scientific *prediction* that actually ends up with 10WPM.

But it's nice to read articles to get some hints.

Although slight modification you can use 8 directions for the 8 banks and have a key for the 'special' chars. Save counter-intuitive to press a button for a bank and directions for others
Well... letters could be located on 8 directions, and pushing the joystick (it's a button also) would switch mode between "letters" and "numbers and special chars". I'll do a prototype of this later.

I think it would be great to have a standard keyboard souce file.
Yep... That's my point.



PS. I successfully defended my MSc thesis today ("Design and implementation of SNMP agent") :)
 
It took me a monent to figure out how the controls work,
but it's a great idea. : )

That would be really cool in some sort of calendar or notebook app,
imagine writing notes into your GP2X on the go. : D
 
Empyre posted on Oct 29 2005 at 12:31 PM said:
I always thought that something like T9 predictive text would be a great way to enter text on a handheld.

Yep... Predictive text is nice, but I don't like T9, because if you enter a word that is not in the dictionary you have to delete it, switch T9 off, enter it again and switch T9 back. If your T9 implementation doesn't automatically add this new word to dictionary than you have to go into "add new word" mode and enter it again (my phone acts this way :angry: ).

Anyway, if I'll not be able to do something better than T9... I'll do T9-like lib for gp*.
 
Last edited by a moderator:
I've done a prototype of T9-like text entry (in Python for PC),
with dictionary of ~2000 common english words
(should cover 80% of communication).

You can download it (30kB) from this location:
http://rapidshare.de/files/6933297/t9ui.py.html

To run this app under windows you must install Python environment:
http://www.python.org/ftp/python/2.4.2/python-2.4.2.msi (10MB)


T9-like prediction can be integrated with entry system described earlier.
That's not all, I came up with new idea based on Quikwriting.

The idea is simple:
* every direction (8) has a letter bank assigned to it
* to enter a letter you must select a bank, select a letter and enter it
* to select a bank you push joystick in one direction and hold it there,
* first letter from active bank is selected now,
* to select next letter from this bank you must do 1/8 circle clockwise without getting
joystick into 'neutral' position (to select next letter you add another 1/8 ),
* to select previous letter from this bank you must do 1/8 circle counter-clockwise
without getting joystick into 'neutral' position,
* getting joystick into 'neutral' position enters selected letter

To bad that this idea is hard to prototype (I don't have a pad)... I'll try doing it with
normal (analog) stick.
 
T9-like prediction can be integrated with entry system described earlier.
That's not all, I came up with new idea based on Quikwriting.

The idea is simple:
* every direction (8) has a letter bank assigned to it
* to enter a letter you must select a bank, select a letter and enter it
* to select a bank you push joystick in one direction and hold it there,
* first letter from active bank is selected now,
* to select next letter from this bank you must do 1/8 circle clockwise without getting
joystick into 'neutral' position (to select next letter you add another 1/8 ),
* to select previous letter from this bank you must do 1/8 circle counter-clockwise
without getting joystick into 'neutral' position,
* getting joystick into 'neutral' position enters selected letter

A simpler idea is like the one I devised for GPDesktop
http://www.gp32.co.nz/gpdesktop.php

* every direction (9) has a letter bank assigned to it, even neutral position. Don't move the joystick to select this bank.
* to enter a letter, select a bank and press the 'A' button once for first letter, twice for second, three times for thrid letter etc. Much easier than quarter circles!
* press 'B' button to delete a letter
* to select a new SET of banks (e.g. capitals, symbols etc) press L or R to cycle back and forth
 
I was thinking along the same lines lying awake brooding the other night! :rolleyes:
But i think t9 may be unnessesary work, mostly since you have quick access to 36 possibilities (9*4, 9th is neutral direction).

I was thinking something like middle direction (neutral) of stick + A, B, X, Y could be common options like space, backspace, carriage return... And each direction is a character bank just as you said. That should be enough for common letters (8*4). Numbers could be entered in "number mode", with stick+button, and 0 as other button. Modes (number mode, capital, special characters, et.c...) could be changed with shoulder buttons.

The bad thing is: ideas like these could be patented, i don't know how those things work... <_<
 
You can't patent something (I believe) if someone can proove 'prior art' - which means that you can't patent something that someone else has done before you and can proove it.

For example, M$ couldn't all of a sudden patent the Automobile and charge everyone with a car a licence fee because it can be proven beyond doubt that cars existed before M$!!
 
pea posted on Oct 30 2005 at 10:37 PM said:
* to enter a letter, select a bank and press the 'A' button once for first letter, twice for second, three times for thrid letter etc. Much easier than quarter circles!

'Multi-tap' systems require waiting for timeout when adjacent letters are on the same key.
Digraphs like "on" and "ed" are common in english.

However I think that the biggest advantage of such 'multi-tap' system is similarity to text entry on some mobile phones. Many mobile phone users are already skilled in 'tapping', and have this skill in their motoric memory (they remember 'with fingers' how many times they have to 'tap' to get desired letter).

I agree that 'tapping' is easier and more precise.


jedthehumanoid said:
But i think t9 may be unnessesary work, mostly since you have quick access to 36 possibilities (9*4, 9th is neutral direction).

T9 with slight modification can also be used for text prediction (e.g. write only 4 letters and the program will give you list of words that start with those 4 letters).

T9 is trivial in Python
Code:
class T9:
    
    def __init__(self, char_list=None):
        if char_list == None:
            char_list = ('abc','def','ghi','jkl','mno','pqrs','tuv', 'wxyz')
        self.char_list = char_list
        self.decoder_dict = {}
        self.init_encoder()

    def set_word_list(self, word_list):
        d = self.decoder_dict
        for w in word_list:
            e = self.encode(w)
            d[e] = d.get(e,list()) + [w]

    def encode(self, text):
        out = '
        for c in text:
            out += self.encoder_dict[c]
        return out

    def decode(self, text):
        return self.decoder_dict.get(text, [text])

    def init_encoder(self):
        char_list = self.char_list
        self.encoder_dict = {}
        d = self.encoder_dict
        group_id = 0
        for group_str in char_list:
            for c in group_str:
                d[c] = str(group_id)
            group_id += 1

Doing it in C... well, it's not easy, but it's also not as hard as many people think.

I think it's worth doing :)
 
Last edited by a moderator:
hmmm.....

Very interesting, and a lot of good ideas out there.

Personally, though, I'd prefer that the banks are selected by ABXY, and then the specific character is selected via joystick.

example: You want to enter the letter 'e'. you hold down the A button (as e is in the first 8 letters of the alphabet), which puts the letter 'a' in, but changes as you rotate the stick around. When you rotate it around to the 5th position (down-left), it is changed to 'e' and you let go of the A button to accept the letter.

Why do I prefer this system? in my opinion, its easier to hold down a button than to hold a stick in a given position. True, neither should realistically give anyone too much grief, but if you're trying to type things in quickly, I think one would end up with more errors if you had to hold the stick in one position while deciding which button to press, instead of the other way around. Just my $0.02 though.

This could easily be integrated with the other systems (dictionaries, etc) mentioned above, and I'd modify the input code noir has graciously provided, if only I was well versed in python and I didnt have this CS homework staring at me.

Just an idea. Take it, leave it, run with it, or ignore it
 
'Multi-tap' systems require waiting for timeout when adjacent letters are on the same key.

Ah, yes, but you are forgetting that you can release the D-Pad and press it again to go back to the same bank, so no delay.

Your example 'ON'

1) Press right, tap three times for 'o'
2) release pad, press right again, tap 2 times for 'n'
 
Just checked out the flash mockup. Looks excellent so far.
One suggestion though: Put the space button in the middle, so it can be hit quickly
without holding the joystick. It would make things a LOT faster.
 
Yeah, good point. I modelled it on mobile phones though so that it would be the same (the letters and space anyway) so it would be a toss-up between familiarity and speed if I was to change the space.
 
pea posted on Oct 31 2005 at 07:32 AM said:
'Multi-tap' systems require waiting for timeout when adjacent letters are on the same key.

Ah, yes, but you are forgetting that you can release the D-Pad and press it again to go back to the same bank, so no delay.

To be honest I haven't thought about that... Your idea is excellent :)

pea said:
Yeah, good point. I modelled it on mobile phones though so that it would be the same (the letters and space anyway) so it would be a toss-up between familiarity and speed if I was to change the space.

I opt for variant with space in central bank. It is still 'ABC' layout (which is beginner-friendly), but it will enable joystick-only-t9 (it cannot be done without pressing additional key when using central bank). IMO suggested change in layout impacts familiarity far less that change from keys (mobile phone) to joystick (gp*), so it's worth a try. And as grahf said: "It would make things a LOT faster".


I like Your idea so much, that from now on I will focus entirely on text prediction / text completion.
 
Last edited by a moderator:
Back
Top