Input menu

What you type on the PC keyboard goes to the machine. A gamepad, or a few keys of the PC keyboard, can work as a joystick, and the PC mouse can work as a Kempston mouse. The Input menu has the commands for all of this: Grab Keyboard, Grab Mouse, Keymap and Gamepads. Their settings are on the Input page of Options. You set the machine’s joystick and mouse interfaces on its Machine page.

The keyboard

The Spectrum keys are where they are on the PC: letters, digits, Space and Enter. The Spectrum’s two shift keys are these PC keys:

PC key

Spectrum key

Shift

Caps Shift

Ctrl

Symbol Shift

The symbol keys ; ' , . / - = type what is printed on them, with Shift too: Shift+; gives :, Shift+' gives ", Shift+/ gives ?. The machine gets each symbol the way it is typed on the Spectrum, as Symbol Shift and a key. Letters and digits work as the Spectrum’s own keys, so Shift+A is a capital A, Shift+0 is DELETE and Shift+9 is GRAPHICS, and games read the keys as they always have. You type the symbols on the digit keys as on the Spectrum, with Ctrl: Ctrl+2 gives @.

To have the symbol keys as fixed Spectrum keys instead, with Shift as Caps Shift, turn off Input > Keymap > Type PC Symbols, or pick Key Positions in the Typing list on the Input page of Options.

Other PC keys press two Spectrum keys together:

PC key

Spectrum keys

Gives

Backspace

Caps Shift + 0

DELETE

arrows

Caps Shift + 5, 6, 7, 8

cursor left, down, up, right

Esc, Tab

Caps Shift + Space

BREAK

Caps Lock

Caps Shift + 2

CAPS LOCK

Page Up

Caps Shift + 3

TRUE VIDEO

Page Down

Caps Shift + 4

INV. VIDEO

Delete

Caps Shift + 9

GRAPHICS

`

Caps Shift + 1

EDIT

\

Caps Shift + Symbol Shift

extended mode

Home

Symbol Shift + Q

<=

End

Symbol Shift + E

>=

[ and ]

Symbol Shift + 8, 9

( and )

With Key Positions, the symbol keys are fixed too:

PC key

Spectrum keys

Gives

;

Symbol Shift + O

;

'

Symbol Shift + P

“

-

Symbol Shift + J

-

=

Symbol Shift + K

+

, and .

Symbol Shift + N, M

, and .

/

Symbol Shift + C

?

The F-keys, Alt, Insert and the numeric keypad do nothing on the machine.

If a key is a hotkey, it runs its command instead of reaching the machine. No hotkey uses Ctrl with a Spectrum key, so Ctrl is always Symbol Shift. Which other keys are hotkeys depends on the set of hotkeys you use. In Modern, Delete, Home, End and Insert are hotkeys, while Esc is left to the machine as BREAK. See Hotkeys page. To give the machine every key, grab the keyboard.

A key is recognized by its place on the keyboard, not by what the system layout puts on it, so a Cyrillic or any other layout changes nothing, and neither does switching layouts. A symbol key types its symbol from the US layout, the Latin one printed on it: on a Russian keyboard, Shift+Ж gives :.

The ZX Spectrum Next reads the keys as its own PS/2 keyboard does, with Shift as Caps Shift (see ZX Spectrum Next). On the Profi, a grabbed keyboard has a layout of its own.

Keymaps

A keymap says which PC key presses which Spectrum key. Pick one in Input > Keymap, or in the Keymap list on the Input page of Options:

  • By machine, the default - each machine uses its own keymap: the ZX Spectrum 48K uses the 48K keymap, the Robik uses the Robik’s, and every other machine uses ZX Spectrum 128K (see A keymap for a machine). The Input page shows which one the current machine uses;

  • ZX Spectrum 128K - the keys described above: both Shift keys are Caps Shift and both Ctrl keys are Symbol Shift, as on a PC keyboard;

  • ZX Spectrum 48K - Caps Shift is on left Shift and left Ctrl, and Symbol Shift on right Shift and right Ctrl, as the two keys are placed on a 48K. The \ key is GRAPHICS (Caps Shift + 9);

  • Robik - the 48K keymap, plus the Robik’s 11 keys of its own at their places on its case (see Robik). Right Alt is its C key and right Ctrl its L key, so only the right Shift is Symbol Shift.

If you pick a keymap by name, it is used on every machine. A keymap changes only the keys it names, and all the others stay as in ZX Spectrum 128K.

On macOS, the left and right Shift, Control and Option keys are told apart too. A MacBook’s keyboard has no right Control, so there the 48K keymap has Symbol Shift on the right Shift.

On a Mac, the Robik keymap puts the Robik’s C on the right Command and its L on the right Option, the two keys to the right of the space bar, as on its case. A right Control is L as well. Command is the emulator’s own key on a Mac, so you press C with a tap: press the right Command and let it go at once, with no other key. If you hold it, alone or with a key, it works for the hotkeys as before.

Your own keymap

A keymap is a text file with the extension .map in the keymaps folder of the settings folder (see Where the settings are). The next time you open the Keymap menu, the file shows there under its name without .map. A file with the name of a built-in keymap is used instead of that keymap. A ZX Spectrum 128K.map left from an earlier version is not listed, because that keymap is built in now. If you changed that file, it is listed as ZX Spectrum 128K.map.

A keymap for a machine

With By machine, a machine uses the keymap with its own name: the Robik uses Robik.map. If a machine of your own (see Machine page) has no keymap of its name, it uses the keymap of the machine it was made from, so Robik (mine) uses the Robik’s. A machine with neither uses ZX Spectrum 128K.

To give a machine a keymap of its own, name the file after the machine as the machine list shows it, letter for letter, without the * of a changed one: Pentagon.map for the Pentagon, My Scorpion.map for a machine named My Scorpion.

Each line is one PC key, then the Spectrum keys it presses, all separated by tabs:

`	C	1
LS	C
RS	S

The first line makes the ` key press Caps Shift and 1 together, which is EDIT. A line with a PC key alone makes that key press nothing. A key that your keymap changes presses what the keymap says, even when Type PC Symbols is on.

PC keys are named 1 to 0, A to Z, ENT, SPC, LS and RS (left and right Shift), LC and RC (Ctrl), LA and RA (Alt), TAB, CAPS, BSP, ESC, F1 to F11, UP, DOWN, LEFT, RIGHT, HOME, END, INS, DEL, PGUP, PGDN, the symbol keys `, \, [, ], ;, " (the quote key), -, + (the = key), ,, ., /, and on the numeric keypad N0 to N9, NDOT, NENT, NPLUS, NMINUS, NMUL, NSLASH, NLOCK. On macOS, LCMD and RCMD are the left and right Command. If you give one of them a Spectrum key, it presses that key when tapped (pressed and let go at once, alone), and it still works for the hotkeys when held.

Spectrum keys are one character each: 1 to 0, the letters in lower case a to z, E for Enter, C for Caps Shift, S for Symbol Shift, and a space for Space.

A PC key can also move the Kempston joystick: JU, JD, JL, JR for up, down, left and right, JF for fire, J2 to J4 for the extra buttons.

A line [macOS], [Windows] or [Linux], in upper or lower case, starts the keys for that system only: the lines after it, up to the next such line, are read only on that system. The lines before the first such line are for every system. This is how the Robik keymap moves its C and L for a Mac’s keyboard:

RA	R
RC	L
[macOS]
RCMD	R
RA	L

R and L in it are the Robik’s own C and L keys.

Grab Keyboard

Input > Grab Keyboard gives the whole PC keyboard to the machine. While it is on:

  • every key reaches the machine, Esc and the F-keys included;

  • the hotkeys stop working, except the key of Grab Keyboard itself (ScrollLock or Alt+G in Modern, Alt+G in Classic);

  • a player set up in Gamepads to use the keyboard no longer gets its keys: they reach the machine as ordinary keys;

  • the commands in the menus and on the toolbar still work.

To release the keyboard, press the Grab Keyboard key again, or press Ctrl and Alt together and release them with no other key in between (Ctrl and Cmd on a Mac). A short message on the picture says when the keyboard is grabbed and released.

Machines with a keyboard of their own

Profi. A Profi has a PC-style keyboard of its own. With the keyboard grabbed, the PC keyboard works as that keyboard: the keys type the characters printed on them, Shift included, and F1 to F10, Home, End, Page Up, Page Down, Insert and Delete give the Profi’s own keys. When the keyboard is not grabbed, the PC keyboard works as the Spectrum keyboard described above.

ATM Turbo 2+ and ZX Evolution. These machines read a PC keyboard as well as the Spectrum one, and every key you press reaches both. You set the scan codes the machine gets in the PC keyboard row in the Input group of the Machine page of Options: As the machine has it, Scanset 1 (XT), Scanset 2 (AT) or Scanset 3 (PS/2). Leave it as the machine has it unless a program asks for another set.

Joysticks

You set the machine’s joystick interface on the Machine page of Options, in the Input group: Joystick is None, Kempston 5-bit or Kempston 8-bit. The 8-bit one has three more fire buttons, Fire 2 to Fire 4. The Scorpion ZS 256 and its Turbo+ have only the 5-bit one: the joystick port on the board has no lines for Fire 2 to Fire 4.

Sinclair, cursor and QAOP joysticks are keys on the Spectrum keyboard, so they need no interface: a player set up in the Gamepads window presses those keys for you.

The ALF TV Game consoles have no keyboard. On them, the arrows with Space or Enter are the first joystick, and W, A, S, D with left Shift or left Ctrl are the second.

Gamepads

The Gamepads window

Click Input > Gamepads, or choose Input > Gamepads > Manage…, to open the Gamepads window (on macOS, only Manage… opens it). It has a tab for each of the two players, Player 1 and Player 2. A change takes effect at once, so there is nothing to apply.

Device - what the player plays with:

  • None;

  • Keyboard: arrows + Ctrl - the arrows, and either Ctrl for fire;

  • Keyboard: WASD + Space;

  • a gamepad connected to the PC, or one used before and now unplugged, marked (not connected).

Under it, a line shows what the last button or key you pressed does, so you can try the pad right there. In the window, the keys of a player on the keyboard work only that line: the arrows do not move around the window. If you plug in a gamepad for the first time, it goes to a player that has no device, and the window opens by itself to show it (not in fullscreen).

On macOS, a gamepad with an XInput / DInput switch is not seen at all in XInput mode, so switch it to DInput.

Joystick - which joystick the Spectrum sees for this player:

Joystick

Up, down, left, right, fire

Kempston

the Kempston interface

Sinclair / Interface II

keys 9, 8, 6, 7, 0

Sinclair port 2 (left)

keys 4, 3, 1, 2, 5

Cursor/Protek/AGF

keys 7, 6, 5, 8, 0

QAOP

keys Q, A, O, P, and Space or M for fire, picked in the list beside it

Custom

Spectrum keys of your own; it starts as QAOP and Space

Picking Kempston switches the machine’s Kempston joystick on if it is off. The rows Fire 2 to Fire 4 are shown only when the machine has the 8-bit Kempston.

The table lists what the player can do. The first rows, in bold, are the joystick: Up, Down, Left, Right, Fire. The second column shows the buttons or keys for each row. On a gamepad the directions are the D-pad and the left stick, shown as Gamepad up and so on, and Fire is every face button no other row uses.

  • Double-click a row, or right-click it and choose Change…, to set its buttons.

  • Add mapping, or Add… on the right-click menu, adds a row of your own.

  • Right-click a row of your own and choose Delete to remove it. On a joystick row, the menu has Back to defaults instead.

  • Tick Turbo on a row to make it repeat while the button is held. Turbo rate sets how fast, from 1 to 25 times a second.

  • Stick dead zone - how far a stick has to move before the move counts. A player on the keyboard has no stick, so the setting is grayed out.

Setting up a row

The window that Change… opens has two sides. The right side, Gamepad or PC Keyboard, lists the buttons or keys that work the row: press the buttons on the pad, or click in the box and press the keys. The PC Keyboard box takes every key, Tab and Enter too, but Esc closes the window without changes. The first button or key you press replaces what the row had, and the next ones are added. Add from list lets you pick a pad input by name, with no pad needed. Clear empties the list, and Defaults puts back the joystick row’s own buttons.

The left side, Spectrum, says what the row does on the Spectrum. On a joystick row, this is set by the Joystick choice, except with Custom, where you pick the key. A row you added can do one of these:

  • Joystick - press up, down, left, right or fire of the player’s joystick, whichever joystick it is;

  • Key - press a Spectrum key: pick it from the list, or click Press and press the PC key it is on. Modifier holds Caps Shift or Symbol Shift with it;

  • Kempston - press a Kempston direction or fire button;

  • Mouse - move the Kempston mouse, press its button or turn its wheel. A move gets faster the longer it lasts;

  • Action - run any command of the emulator, as its hotkey does.

Turbo: repeats while held is the same as the row’s Turbo box. OK keeps the changes.

Saving the bindings

Save as… writes the player’s table to a .pad file, and Load… reads one back. Its menu lists by name the last eight files you loaded or saved, with a check by the one the table matches, and Browse… below them for any other file. If there are no such files yet, Load… opens the file dialog at once. Reset sets the player back to the joystick’s defaults and deletes the rows you added.

Game bindings. If the Game bindings box on the Input page of Options is ticked, Xpeccy+ looks for a .pad file of the same name beside each tape, disk or snapshot you open: for Exolon.tzx that is Exolon.pad. Player 1 uses those bindings until you open the next file (if you pick another side of the game from its list, the bindings stay). The window then says From Exolon.pad, until the next image, beside a Revert button that goes back to your own bindings. Save as… offers that name and place, so you can save a table for a game with one click.

If you change player 1’s bindings while a game’s file is in use, Xpeccy+ asks where the change goes. Game config saves it into the game’s .pad file, User config makes the table your own, and Temporary keeps it until the next file. Cancel, Esc, or closing the question undoes the change.

Quick switch

Input > Gamepads also lists the joysticks for player 1, with the device in use above them, so you can switch from Kempston to Sinclair mid-game without opening the window. Below them, Saved presets lists the same files as Load…, and Reset to defaults goes back to the joystick’s defaults. The Input page of Options shows what each player has, with a Gamepads… button that opens the window.

Mouse

To use the PC mouse as a Kempston mouse, set Mouse to Kempston mouse in the Input group of the Machine page of Options. The button beside it opens its settings:

  • Sensitivity - how fast the pointer moves. In the middle position the Spectrum pointer moves as fast as the PC pointer.

  • Wheel - the wheel is read too, as on the extended Kempston mouse.

  • Swap buttons - the left and right buttons trade places, for a program that reads them the other way round.

The machine gets the mouse only while the mouse is grabbed. Grab it in one of these ways:

  • click the picture with the middle button (the Middle Click of Grab Mouse in Hotkeys);

  • click the picture with the left button, while a program reads the mouse;

  • Input > Grab Mouse.

While the mouse is grabbed, the PC pointer is hidden and the buttons go to the machine, and so does the wheel if Wheel is ticked. The same hand movement moves the Spectrum pointer the same distance, whatever size the picture is drawn at. To release the mouse, click the middle button again, use Grab Mouse again, or press Ctrl and Alt together and release them (Ctrl and Cmd on a Mac). If you take the middle click away from Grab Mouse, the middle button goes to the machine too.