Hi,
I've got the following:
Code:
10 DIM R 3
20 PROCasm
30 MODE 7
40 REPEAT
50 !R=USR(keyScan)
60 PRINT TAB(0,1) R?1
70 UNTIL FALSE
80 END
90 DEFPROCasm
100 FOR P=0 TO 2 STEP 2
110 P%=&900
120 [OPT P
130 .keyScan
140 LDA #121
150 LDX #0
160 JSR &FFF4
170 RTS
180 ]
190 NEXT P
200 ENDPROC
The problem I'm having is while I get most keys back as expected (eg Z gives me 97), some keys such as U return 5, while CTRL and SHIFT don't do anything at all.
Printing out the values at &EC and &ED also works as expected, although I've no idea if these locations work across all the BBC micros.
I realise I'm probably doing something daft but can't fathom it tonight!
EDITThat's interesting - Just tried it on the emulator here and pressing U gives me 53, yet on my real BBC at home it was 5... Weird