z80:GetKey Codes

From Learn @ Cemetech
Jump to navigationJump to search

GetKey Key Codes

Key Codes returned from the GetKey ROM Call. Note that GetKey accepts inputs from Secondary functions (2nd), Alpha functions (ALPHA), and Alpha-Lower functions (ALPHA-ALPHA) keys.

The table of key code values is stored at (KeyExtend).

kExtendEcho2 ($FC) holds the last key code returned from GetKey, which is also stored into the accumulator after calling GetKey.

Regular Key Codes

Key Code Equate Key Code Equate Key Code Equate
> kRight $01 !! < kLeft $02 !! Λ kUp $03
V kDown $04 !! [ENTER] kEnter $05 !! [CLEAR] kClear $09
[ZOOM] kZoom $2E !! [STAT] kStat $31 !! [MATH] kMath $32
[VARS] kVars $35 !! [GRAPH] kGraph $44 !! [MODE] kMode $45
[WINDOW] kWindow $48 !! [Y=] kYEqu $49 !! [TRACE] kTrace $5A
[+] kAdd $80 !! [-] kSub $81 !! [*] kMul $82
[÷] kDiv $83 !! [(] kLParen $85 !! [)] kRParen $86
[STO=>] kSto $8A !! [,] kComma $8B !! [(-)] kChs $8C
[.] kDecPnt $8D !! [0] k0 $8E !! [1] k1 $8F
[2] k2 $90 !! [3] k3 $91 !! [4] k4 $92
[5] k5 $93 !! [6] k6 $94 !! [7] k5 $95
[8] k8 $96 !! [9] k9 $97 !! [X,T,θ,n] kVarX $B4
[SIN] kSin $B7 !! [COS] kCos $B9 !! [TAN] kTan $BB
[X^^2^^] kSquare $BD !! [LN] kLn $BF !! [LOG] kLog $C1

Secondary Function Key Codes

Key Code Equate Key Code Equate Key Code Equate
[INS] kIns $0B !! [RCL] kRecall $0C !! [ENTRY] kLastEnt $0D
[2nd] + < kBOL $0E !! [2nd] + > kEOL $0F !! [DRAW] kDraw $2F
[TEST] kTest $33 !! [MEM] kMem $36 !! [MATRIX] kMatrix $37
[DISTR] kDist $38 !! [ANGLE] kAngle $39 !! [LIST] kList $3A
[CALC] kCalc $3B !! [CATALOG] kCatalog $3E !! [OFF] kOff $3F
[QUIT] kQuit $40 !! [LINK] kLinkIO $41 !! [STAT PLOT] kStatEd $43
[TABLE] kTable $4A !! [TBLSET] kTblSet $4B !! [FORMAT] kFormat $57
[[] kLBrack $87 !! []] kRBrack $88 !! [EE] kEE $98
[π] ] kPi $B5 !! [SIN^^-1^^] kASin $B8 !! [COS^^-1^^] kACos $BA
[TAN^^-1^^] kATan $BC !! [√] kSqrt $BE !! [e^^x^^] kExp $C0
[10^^x^^] kALog $C2 !! [Ans] kAns $C5 !! !! !! !!

These are also Secondary function key codes, but note that they overlap with the Alpha-Lower keys. It is important to check the LwrCaseActive flag to make sure that the key press is indeed a secondary function key instead of a lower case key.

Key Code Equate Key Code Equate Key Code Equate
[{] kLBrace $EC !! [}] kRBrace $ED !! [i] kI $EE
[e] kCONSTeA $EF !! [L1] kL1A $F3 !! [L2] kL2A $F4
[L3] kL3A $F5 !! [L4] kL4A $F6 !! [L5] kL5A $F7
[L6] kL6A $F8 !! [u] kUnA $F9 !! [v] kVnA $FA
[w] kWnA FB !! !! !! !! !! !! !! !!

Alpha Key Codes

Key Code Equate Key Code Equate Key $Code Equate
[SOLVE] kAlphaEnter $06 !! Page Up kAlphaUp $07 !! Page Down kAlphaDown $08 (1)
[_] kSpace $99 !! [A] kCapA $9A !! [B] kCapB $9B
[C] kCapC $9C !! [D] kCapD $9D !! [E] kCapE $9E
[F] kCapF $9F !! [G] kCapG $A0 !! [H] kCapH $A1
[I] kCapI $A2 !! [J] kCapJ $A3 !! [K] kCapK $A4
[L] kCapL $A5 !! [M] kCapM $A6 !! [N] kCapN $A7
[O] kCapO $A8 !! [P] kCapP $A9 !! [Q] kCapQ $AA
[R] kCapR $AB !! [S] kCapS $AC !! [T] kCapT $AD
[U] kCapU $AE !! [V] kCapV $AF !! [W] kCapW $B0
[X] kCapX $B1 !! [Y] kCapY $B2 !! [Z] kCapZ $B3
[:] kColon $C6 !! [?] kQuest $CA !! ["] kQuote $CB
[θ] kTheta $CC !! !! !! !! !! !! !! !!

Alpha-Lower Key Codes

To Enable Alpha-Lower you need to set the LwrCaseActive Flag. Note that these values do overlap with some of the secondary function key values so you will need to test LwrCaseActive to make sure it is really Alpha-Lower instead of a secondary function key.


   SET LwrCaseActive,(IY+AppLwrCaseFlag)


Key Code Equate Key Code Equate Key Code Equate
[a] kLa $E2 !! [b] kLb $E3 !! [c] kLc $E4
[d] kLd $E5 !! [e] kLe $E6 !! [f] kLf $E7
[g] kLg $E8 !! [h] kLh $E9 !! [i] kLi $EA
[j] kLj $EB !! [k] kLk $EC !! [l] kLl $ED
[m] kLm $EE !! [n] kLSmalln $EF !! [o] kLo $F0
[p] kLp $F1 !! [q] kLq $F2 !! [r] kLSmallr $F3
[s] kLs $F4 !! [t] kLt $F5 !! [u] kLu $F6
[v] kLv $F7 !! [w] kLw $F8 !! [x] kLx $F9
[y] kLy $FA !! [z] kLz $FB !! !! !! !!

Information taken from Sigma's Learn ASM in 28 days, [*http://dragonfire.unitedti.org/asmin28/ref/keycodes.html Key Codes]