MXLock is a two-chip circuit that allows up to four mechanically locking keys (push-on, push-off) to be simulated using regular momentary key switches.
Many older computer keyboards have mechanically locking keys. For example, the Commodore 128 has three locking keys: SHIFT LOCK
, CAPS LOCK
, and 40/80
. The MXLock circuit can be included on the PCB of replacement keyboard projects, such as those using Cherry MX keys, so that the entire keyboard can be made from momentary key switches.
Features:
- Simulates up to 4 locking keys using an ATtiny214/414/814 and a 4066
- Shows the on/off state of each key with LEDs
- Remembers the lock states between power cycles (useful for mode keys like
40/80
) - Resets the computer by pulling
/RESET
low if a key is held down
The hardware/
directory in this repository contains the schematic and a PCB layout for the demonstration board pictured above. It can be used to test the MXLock circuit.
The circuit is intended to be integrated directly onto the PCB of a keyboard. Steve Gray's C128SX keyboard is an example of a keyboard using the circuit.
The firmware is written in AVR assembly language. It can be assembled and flashed using open source software and inexpensive hardware. See firmware/
for the source code and instructions.
A circuit to simulate locking keys with momentary ones is not a new idea. Here are some others:
-
Johan Grip uses three MAX16054s and a 74AUC1G66 for the
CAPS LOCK
,SHIFT LOCK
, and40/80
keys on the C128. -
MtnBuffalo uses a 555 and a 4066 for the
SHIFT LOCK
key on the C64.
MXLock differentiates itself by its low parts count (two chips for four keys) and its ability to remember the lock states between power cycles.