CircuitGizmos

Electronic Products for Creative Minds

  • Home
  • Gizmo Store/Products
  • Documentation/Datasheets
  • Projects/Libraries
  • GizmoBlog
  • Services/Contact
    • Design
    • Contact Gizmo!
  • Your Gizmo Cart
    • Your Account
You are here: Home / GizmoBlog / MMBasic Language / Keyboard / Special Keyboard Keys

Special Keyboard Keys

MMBasic generates a single unique character for the function keys and other special keys on the keyboard.

These are shown in the table as hexadecimal and decimal numbers:

Keyboard Key Key Code (Hex) Key Code (Decimal)
Up Arrow 80 128
Down Arrow 81 129
Left Arrow 82 130
Right Arrow 83 131
Insert 84 132
Home 86 134
End 87 135
Page Up 88 136
Page Down 89 137
Alt 8B 139
Num Lock 8C 140
F1 91 145
F2 92 146
F3 93 147
F4 94 148
F5 95 149
F6 96 150
F7 97 151
F8 98 152
F9 99 153
F10 9A 154
F11 9B 155
F12 9C 156

If the control key is simultaneously pressed then 20 (hex) is added to the code (this is the equivalent of setting bit 5). If the shift key is simultaneously pressed then 40 (hex) is added to the code (this is the equivalent of setting bit 6). If both are pressed 60 (hex) is added. For example Control-PageDown will generate A9 (hex).

The shift modifier only works with the function keys F1 to F12; it is ignored for the other keys.

MMBasic will translate most VT100 escape codes generated by terminal emulators such as Tera Term and Putty to these codes (excluding the shift and control modifiers). This means that a terminal emulator operating over a USB or a serial port opened as console will generate the same key codes as a directly attached keyboard. This is particularly useful when using the EDIT command.

KEYDOWN FUNCTION

The KEYDOWN function makes it easy to tell if the user is holding down a key like an arrow key.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

A Ton of Documentation

Open all | Close all

Projects made by Gizmo, Friends, and Members

open all | close all

Recent GizmoBlog Musings

  • Altair 8800 using a ColorMax!
  • Re-energizing the ColorMax, Pt. 3

Visit us!

  • Facebook

Electronic Products for Creative Minds

CircuitGizmos is your source for electronic products that help you create your embedded projects. Here at CircuitGizmos.com you will find a friendly store filled with creative products and all of the documentation that you need to use these gizmos.

We create devices that we believe make electronics fun, but we also know that our products are used for professional designs. For decades we have designed products for commercial, military, and medical industries. Our gizmos here are great for engineers and hobbyists alike.

Copyright © 2008+ CircuitGizmos, L.L.C. All rights reserved

Image already added

Recently Viewed Products

Copyright © 2025 · Generate Pro Theme on Genesis Framework · WordPress · Log in