Virtual keyboard

A 40-key virtual keybord located in the workspace provides control over the emulator similar to a real ZX Spectrum keyboard. The left mouse button click over a virtual key makes it pressed. With the help of the mouse wheel a virtual key can be held in the pressed state, either till any next virtual key is pressed (wheel up) or till the explicit repeated press on the same pushed key (wheel down). The virtual keyboard itself (as like as display though) can be draged to any location in the workspace.

Every key (as well as the original one) serves several purposes. The current one depends as on the mode the emulator shell in, as the extra keys Caps Shift (CS) and Sysmbol Shift (SS) pushed at the moment:

The control described earlier usually is used in the standard system shell only. The most of programs and games keyboard keywords and modes don't have any meaning. The table shows the frequently used keys and their typical actions in games:

Command/Action Typical key
Up Q, K, CS + 7
Down A, M, CS + 6
Left O, Z, CS + 5
Right P, X, CS + 8
Fire M, BR, CS + 0

IBM PC Keyboard

Everything which has been said before can be applied to the physical IBM PC keyboard. Press on the physical key triggers press on one or a few virtual keys (they can be seen by highlight).

The most of IBM PC keys correspond eponymous ZX Spectrum virtual keys. The following table displays the full key mapping:

IBM PC key ZX Spectrum keys
0 ... 9 0 ... 9
A ... Z A ... Z
Space Break
Left Ctrl, Right Shift Symbol Shift
Left Shift, Right Ctrl Caps Shift
Caps Lock Caps Shift + 2
Left arrow Caps Shift + 5
Down arrow Caps Shift + 6
Up arrow Caps Shift + 7
Right arrow Caps Shift + 8
Backspace Caps Shift + 0
, Sysmbol Shift + N
, with right shift Sysmbol Shift + R
. Symbol Shift + M
. with right shift Symbol Shift + T
/ Symbol Shift + V
/ with right shift Symbol Shift + C
: Symbol Shift + O
: with right shift Symbol Shift + Z
' Symbol Shift + 7
' with right shift Symbol Shift + P
- Symbol Shift + J
- with right shift Symbol Shift + 0
= Symbol Shift + L
= with right shift Symbol Shift + K

Virtual Kempston mouse

A ball and three buttons over it, placed to the right of the virtual keyboard, represent virtaul Kempston mouse (or trackball?). The ball can be pulled with the left PC mouse button at the different directions, sending the corresponsing commands to the emulator. The purpose of the buttons is obvious. A short PC mouse button click on the ball emulates a virtual mouse button click as well.

IBM PC mouse

If your browser supports Pointer Lock API, it's possible to click on the virtual display by the left mouse button in order to control virtual pointer inside the emulator by moving the IBM PC mouse. It is worth to remeber, however, that each virtual coordinate is stored as byte. Therefore, fast pointer movements (especially with high DPI) can lead to impossibility of programs to detect valid virtual pointer offset. The virtual pointer will jump over the screen. To exit the pointer lock mode you should usually press Escape button on the keyboard.

Where to begin?

Insert the disk of your choice in the virtual drive A. Using arrows, select TR-DOS menu item and press Enter. Next, press R key (RUN command will appear) and then press Enter. Good luck! ;)

ZX Spectrum online emulator in JavaScript

Next hardware has been implemented:

Other features:

The project is non-profit project, with opened source code under the MIT license.

Used third party projects (many thanks to their authors!):

ayumi-js Author: Peter Sovietov
Javascript version: Alexander Kovalenko
MIT license
zip.js Copyright (c) 2023, Gildas Lormeau BSD 3-Clause License
Knockout Copyright (c) 2010 Steven Sanderson, the Knockout.js team, and other contributors MIT license
jQuery Copyright OpenJS Foundation and other contributors MIT license

Comments are welcome at xmypuk1985@mail.ru