|Five keys plus thumb operated shift/control key|
The five main keys are located under the fingertips and thumb of the right hand, plus an additional shift key that can be held down with the thumb. This combination allows up to 64 key combinations - which is enough for simple ascii, alphas and numerals.
However, this time the application is not for text entry, but to allow very rapid access to menu items, tools and colour options for a CAD program - without having to break concentration and use the keyboard.
In the early 1990's, Charles Moore - the founder of the Forth programming language, devised a similar simple keypad, to allow him fast, direct and immediate control of his OKAD suite of VLSI CAD design tools. It means that all the frequently used options, for example the toolset in CAD, are immediately below your fingertips and accessible without remembering a series of keyboard strokes or moving the mouse off the working drawing area, to the menu bar, to select a new tool.
If this multi-keypad were combined with the position and scrolling functions currently provide by a mouse, then it would mean that a considerable amount of program interaction could be done from the "mousekey" without having to take one's hand of the mouse to type at the keyboard.
The keypad will interface directly into the Atari joystick port of a Classic Computing Shield that I purchased from Gadget Factory - as part of the Papilio Duo development kit. I am slowly developing a stand alone CAD workstation, based around a 32 bit soft processor running on the Papilio Duo FPGA.
The wiring is very simple - just 6 microswitches connected to inputs pins which short to ground when pressed. The Computing Shield provides 47K pull-up resistors - such that the port lines will all appear high until a keyswitch is pressed. The wiring schematic is provided in the Computing Shield hardware guide
For the moment, the keypad inputs will have to be polled, but a little more logic - such as 6 diodes, would allow a further line to indicate an interrupt from the keypad - if any switch is pressed, the diode AND (inverted logic OR) would bring the interrupt line low.
Decoding the key inputs in code is fairly simple - we assign binary weights to each of the key inputs, and then the unique combination of switch presses is the binary sum of these weights.
For example - assign a weight of:
1 to switch 1,
2 to switch 2,
4 to switch 3,
8 to switch 4,
16 to switch 5,
32 to switch 6.
If switches 1 and 2 are pressed together, the decoding returns a value of (2+1) = 3.
Some consideration was given to switch debounce - multiple sampling of the key-inputs until a stable, repeatable sum is achieved.
The keypad is first scanned to see if any key is pressed. If there is, we wait for 30mS and scan again. We then wait a further 30mS and scan a second time. If the first and second scans are equal - we know we can return with a valid keycode.
Why a Custom Keypad?
The keypad provides a simple and fast means of navigating and selecting a wide range of options from a menu.
It may be used for causing a quick change in operation - such as an original games controller.
It can also be used for text input - but this requires a bit of practice and learning the character set.