Product specifications
The result is returned in A and will be a standard ASCII value or a specific non-ASCII
MTX keyboard value.
If the zero flag is set then no key has been pressed
If the zero flag is not set then a key has been pressed
To access KBD perform the command ‘CALL £0079’
An important point to note concerning KBD is that it makes use of the variable
LASTKEY to remove debouncing problems.
KBD is normally used as part of BASIC and will therefore perform BASIC error and
escape sequences. If you do not wish the break key to be serviced, then you must
disable it prior to calling this routine through the location INTFFF £FD5E (Hex), 64826
(Decimal).
This location can also be used to enable or disable auto-repeat, sound, sprite
movement and cursor flash.
Referring to the table below. If a bit is set then the feature it enables is ON. If a bit is
not set then the feature it enables is OFF.
INTFFF Bit 0 Sound
Bit 1 Break key
Bit 2 Keyboard auto repeat
Bit 3 Sprite movement and cursor flash
Bit 4 User 1
Bit 5 User 2
Bit 6 User 3
Bit 7 (Unused at present)
Another important location is be aware of is KBDFLG at location £FA91 (Hex), 64145
(Decimal). This provides three more features listed below. If a bit is set then the
feature it enables is ON. If a bit is not set then the feature it enables is OFF.
KBDFLG Bit 7 Alpha lock
Bit 5 Page/Scroll
Bit 2 Numeric keypad
Points to Look Out For
5.5
If you are running a section of code and for some reason BASIC is disabled the KBD
routine described in section 5.4 will not work. It may be necessary to run an edited
version of KBD in RAM which is completely independent of BASIC as an integral part
of you programme. This alternative version of KBD is listed in appendix F.
If you are considering writing an item of software for the MTX which is joystick based,
it is worthwhile noting that the vast majority of software uses the right joystick as
describe in this section (see guide to prospective software writers – section 10).