Wednesday, 9 September 2015

Multiple Layers and Keyboard Mode Selection

After deciding last post that the keyboard code required separate emulation and standard PS2 layers, I got to work on some test code and some additions to the LeoStick circuit adding some visual clues and a mode switch button. The result, while still in need of a lot of work to get functioning as I would like, works quite okay for the moment.

So what have we added exactly? There are now 2 major keyboard layers, selectable via a momentary switch. Emulation mode, is for use with ZX81 emulator software and simply passes through key presses as expected by an emulator. The Second mode, or Standard mode attempts to provide the functionality of a PS2 keyboard.

To access a large portion of a PS2 keyboards functionality, various modes are selectable by using the standard mode keys on the ZX81 keyboard.

Three LEDs are used to indicate the keyboard layer selected and while in the Standard layer they also serve to indicate what mode the keys are in. This is not required in emulator mode as the emulator provides it's own visual feedback.

I haven't decided on a final layout as yet, as the underlying code is still in a state of flux.

Normal Layer: Keyboard Mode and Function Selection
NORMALNormal mode.
SHIFTSymbols in Red are selected. Where these red keys are commands, for example 'EDIT or SLOW' they have been replaced by another symbol. All common symbols are now present on the keyboard.
SHIFT,FUNCTIONChanges to Function mode. This selects upper case characters. Pressing the SHIFT key in this mode will select symbols as normal.
SHIFT,GRAPHICSAll the number keys are now there equivalent 'Fx' key, ie. '1' becomes 'F1'. Letter become 'CTRL Letter'. Holding down the SHIFT key in Graphics mode changes the letter keys to 'ALT Letter', number keys '1' and '2' become 'F11' & 'F12'.


A small demo of the keyboard in action.