Skip to content
This repository has been archived by the owner on Oct 12, 2020. It is now read-only.

keyboard mapping

LGB edited this page Mar 21, 2016 · 3 revisions

Keyboard handling of Xep128

Keyboard - of course - is used to emulate Enterprise keyboard in Xep128, but also for some important functions as "hot keys". The layout of the keyboard (and also of hot keys) can be modified by the user, see later.

Default hot keys

Default hot keys in Xep128 are to following:

  • F9: exit
  • F10: screenshot (in PNG format)
  • F11: toogle full screen on/off
  • Pause/break: RESET (if SHIFT also pressed, then cold reset, with clearing the memory first)
  • Page Up: increase CPU speed (available options: 4MHz, 6MHz, 7.12Mhz, 10MHz)
  • Page Down: decrease CPU speed

Emulated Enterprise keyboard

Keyboard emulation of the Enterprise is done in a position (rather than symbolic) way. That means, SHIFT is forwarded as a key event, thus, it's only possible to emulate keyboard layout, where the shifted/unshifted key press status is the same on your PC keyboard and would be on the real Enterprise as well. The default keyboard layout tries to imitate the layout of the EP, eg next to letter 'L' there is ':'. Also, please note, that your non-US keyboard layout may create an odd situation. Xep128 uses SDL scan codes, which may or may not means the real keys even not on the PC keyboard, if you use a national keyboard layout :(

The default keyboard layout can be seen by viewing the configuration file sample written by Xep128, for more information: see here.

Using your own layout

It's possible to re-define keys, though it's not so much comfortable in current versions of Xep128. First of all, please note that I've written before: the meaning of "symbolic mapping" of keys. The basic method to do the re-definition is using a configuration file. You'll see options like this:

epkey@56 = Backspace    # ERASE    
epkey@27 = Tab     # TAB
epkey@37 = Escape  # ESC
epkey@a0 = Keypad 5     # ExtJoy FIRE
epkey@ff = F11  # EMU fullscreen

Just some random lines I've shown here. You can see three different kind of information here per line:

  • the hex number after '@' identifies the EP keyboard matrix position or some special EMU function ("hot-key") if it is not a real EP keyboard matrix position
  • the value after '=' is the "SDL keyscan name" for the given key (ie your PC key)
  • the comment itself (after '#') is not used by the configuration parser of course, it just shows the meaning of the EP keyboard matrix position meaning.

What you can do, is basically only modify the values after '=' and leave the other things as-is.

Key names

Now, you can ask: how can you know the exact names of keys? If you do even a mistake in the configuration file, configuration parser will yell and refusing to start emulation. The somewhat odd trick now, to use :XEP command, an undocumented feature (it is not shown in :XEP HELP either): :XEP SHOWKEYS. This turn OSD for keyboard events on/off. So when activated you can see the name of a given key pressed, and you can use that information in the configuration file (note the quotation marks are not needed, just the text between them).

Clone this wiki locally