CHR$(0) + CHR$(76) [5 NumberPad] "L" (NumLock off in QB64)
CHR$(0) + CHR$(77) [→] Arrow "M"
CHR$(0) + CHR$(79) [End] "O"
CHR$(0) + CHR$(80) [↓] Arrow "P"
CHR$(0) + CHR$(81) [Page Down] "Q"
CHR$(0) + CHR$(82) [Insert] "R"
CHR$(0) + CHR$(83) [Delete] "S"
CHR$(0) + CHR$(84-93) [Shift] + F1-10
CHR$(0) + CHR$(94-103) [Ctrl] + F1-10
CHR$(0) + CHR$(104-113) [Alt] + F1-10
CHR$(0) + CHR$(114-119) [Ctrl] + keypad
CHR$(0) + CHR$(120-129) [Alt] + number
CHR$(0) + CHR$(130 or 131) [Alt] + _/- or +/= "é" or "â"
CHR$(0) + CHR$(133) [F11] "à"
CHR$(0) + CHR$(134) [F12] "å"
CHR$(0) + CHR$(135) [Shift] + [F11] "ç"
CHR$(0) + CHR$(136) [Shift] + [F12] "ê"
CHR$(0) + CHR$(137) [Ctrl] + [F11] "ë"
CHR$(0) + CHR$(138) [Ctrl] + [F12] "è"
CHR$(0) + CHR$(139) [Alt] + [F11] "ï"
CHR$(0) + CHR$(140) [Alt] + [F12] "î"
{{WhiteEnd}}
:In '''QB64''', [[CVI]] can be used to get the [[_KEYDOWN]] 2-byte code value. Example: '''{{text|status <nowiki>=</nowiki> _KEYDOWN(CVI(CHR$(0) + "P"))|green}}'''
''Example 3:'' Use [[UCASE$]](INKEY$) in a keyboard read loop looking for uppercase "Y" or "N" user inputs to avoid multiple IF statements.
L = {{Cl|LEN}}(entry$) ' check entry length for possible backspace
{{Cl|IF}} K$ = {{Cl|CHR$}}(46) {{Cl|AND (boolean)|AND}} flag = 0 {{Cl|THEN}} entry$ = entry$ + K$: flag = 1: mark = L ' decimal point
{{Cl|IF}} K$ = {{Cl|CHR$}}(8) {{Cl|AND (boolean)|AND}} L > 0 {{Cl|THEN}} ' backspace pressed and entry has a length
entry$ = {{Cl|MID$}}(entry$, 1, L - 1) ' remove one character from entry$
{{Cl|IF}} {{Cl|LEN}}(entry$) < mark {{Cl|THEN}} flag = 0 ' allow decimal point entry if other was removed.
{{Cl|LOCATE}} {{Cl|CSRLIN}}, {{Cl|POS}}(0) - 1: {{Cl|PRINT}} {{Cl|SPACE$}}(1); ' remove end character from screen
{{Cl|END IF}}
{{Cl|LOCATE}} 10, 32: {{Cl|PRINT}} entry$; ' display entry to user (semicolon required for correct {{Cl|POS}})
{{Cl|LOOP}} {{Cl|UNTIL}} K$ = {{Cl|CHR$}}(13) {{Cl|AND (boolean)|AND}} L > 0 'assures something is entered '' ''
{{CodeEnd}}
: ''Explanation:'' [[SLEEP]] waits for a keypress. It also allows background programs to share the processor and it leaves the keypress in the buffer for INKEY$. Keyboard string number characters range from [[ASCII]] codes 48 to 57. Any other entry is ignored by the IF statement. A decimal point (code 46) entry is allowed once in the input. The flag value stops further decimal point additions. Backspacing (code 8) is also allowed if the entry has at least one character. The cursor column returned by [[POS]](0) reverts too after the end of the entry when printed each loop. The loop exits when [Enter] (code 13) is pressed and the entry has a length.
{{Cl|IF...THEN|IF}} b% > 119 {{Cl|AND (boolean)|AND}} b% < 130 {{Cl|THEN}} ' Alt + number codes only
C% = b% - 119 ' convert to actual number
{{Cl|IF...THEN|IF}} C% > 9 {{Cl|THEN}} C% = 0
num$ = num$ + {{Cl|LTRIM$}}({{Cl|STR$}}(C%))
{{Cl|END IF}}
{{Cl|END IF}}
{{Cl|LOOP}} {{Cl|UNTIL}} {{Cl|LEN}}(num$) = 3 ' 3 digit codes only
{{Cl|PRINT}} num$
{{Cl|PRINT}} {{Cl|CHR$}}({{Cl|VAL}}(num$)'' ''
{{CodeEnd}}{{small|Code by Ted Weissgerber}}
{{OutputStart}} 155 ¢ {{OutputEnd}}
:''Explanation:'' Hold down Alt key and press 3 keyboard code number keys. '''Number pad keys may not work.''' Note that [[INKEY$]] cannot read Alt, Ctrl or Shift key presses without a key combination and the return is CHR$(0) + CHR$(code).