80-Bus News |
September–October 1984 · Volume 3 · Issue 5 |
Page 7 of 47 |
---|
When Nas-Sys scans the keyboard it stores the state of all the keys in 9 “KMAP” positions, known as KMAP0 to KMAP8, at locations 0C01 to 0C09 hex, 3073 to 3081 decimal. These are updated every time the keyboard is scanned.
The chart shows the Nascom 2 keyboard as layed out. Beneath the legend for each key is the address and below that it’s contents after a keyboard scan when that key is pressed. This is shown in both Hex and decimal notation. The contents remain the game on repeated scans until the key is released. Since each key is bit-mapped it can be detected irrespective of how many keys are simultaneously pressed. When several keys sharing the same map address are pressed, the content is the sum of the values for all the keys pressed.
Note that SHIFT does not change the contents for any key but only puts 10 (hex), 16 (dec) in KMAP0. Similarly GRAPH and CTRL are mapped as any other key.
When Key presses are required to control features of programmes, the use of this table avoids involvement with repeat keyboard routines and their associated adjustable delays.
Example:
KMAP0 is “duplicated” as KMAP8 at 0C09 hex (3081 decimal) and properly should be used instead. In practice I nave never found any difficulty either way.
Page 7 of 47 |
---|