3

I have USB numeric keypad like this:

enter image description here

I need to write chars (A to Z) on this keyboard, and so my idea is to use it like on old cell phone:

enter image description here

If I press 1x 2 it writes A, 2x 2 - B, 4x 9 - Z, etc.

Is possible to do it? And how? Using udev?

4
  • I want to know the purpose of doing this.
    – Prasanna
    Jul 30, 2014 at 17:44
  • 1
    It would allow full (-ish) text entry on a rather small keyboard, potentially useful for small/embedded systems. I'd be curious if anyone's developed anything.
    – baochan
    Jul 30, 2014 at 20:59
  • 1
    Purpose is for example in embedded system. Why old cell phones do not have full-qwerty keyboard?
    – martin
    Jul 31, 2014 at 10:56
  • 1
    Take a look at this solution on StackOverflow
    – Vinayak
    Aug 4, 2014 at 20:56

2 Answers 2

2

I don't have a full answer, but here are some things that may help.

If your keypad is hooked up to a computer with a gui desktop based on Gnome or KDE, AutoKey can be used to turn the keys into hotkeys which can do almost anything you can think of. Since key presses on the pad are probably indistinguishable from the corresponding keys on your regular keyboard, anything you do will affect them as well.

Run xev from a terminal and press each key on the pad to see what keycodes are generated. They're probably the same as those for a normal keyboard, but if not, you can use those codes to differentiate the two.

If you are on an embedded system (or even a server) with no gui, the above won't work.

I'm not very versed in Linux devices, but this post may give you a clue as to how to process keyboard input directly into a script or program. Once you get the key presses into the script, you can do whatever you like in response to them.

Since this is a script/program, you'd have to figure out a way to get its output to the desired destination.

The first approach that comes to mind is using a pipe. That will work if the output is only going to one program.

If the solution needs to be a bit more general, a named pipe may work. I haven't had to use those yet, so I'm a bit sketchy on how you would use the same named pipe serially connected to different programs.

1

Solution is use multipress input method.

In app is need to set multipress input method manually. If you want have multipress as default you need to create file /.xinputrc with content:

GTK_IM_MODULE=multipress
QT_IM_MODULE=multipress

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .