You can try it for yourself by running the program below (compatible with both BB4W and BBCSDL), or you can run it in a suitable browser here (sorry, not IE or any iOS browsers).
Even more strange is that (on this laptop at least) if you press and hold down the right-hand Ctrl key before pressing the Alr Gr key, then the left Crtl key will then not report being pressed! So it depends on the order in which the keys are pressed.
To avoid this behaviour upsetting your own programs you can usefully test for a Ctrl key being pressed as follows:
Code: Select all
IF INKEY(-2) AND NOT INKEY(-9) THEN ...
Code: Select all
VDU 23,22,800;300;8,16,16,0
VDU 23,128,8,16,32,127,32,16,8,0
VDU 23,129,0,16,56,&54,&92,16,16,0
VDU 23,130,0,16,16,&92,&54,56,16,0
VDU 23,131,16,8,4,254,4,8,16,0
REM Global arrays:
DIM Legend$(4,13), InKey%(4,13), Width(4,13), Height(4,13)
REM Legends:
Legend$() = "`","1","2","3","4","5","6","7","8","9","0","-","=","Backspace", \
\ "Tab","Q","W","E","R","T","Y","U","I","O","P","[","]","Enter", \
\ "Caps","A","S","D","F","G","H","J","K","L",";","'","#","", \
\ "Shift","\","Z","X","C","V","B","N","M",",",".","/","Shift","", \
\ "Ctrl","Alt"," Space","AltGr","Ctrl",CHR$128,CHR$129,CHR$130,CHR$131
REM Negative INKEY codes:
InKey%() = 46,49,50,18,19,20,53,37,22,39,40,24,94,48, \
\ 97,17,34,35,52,36,69,54,38,55,56,57,89,74, \
\ 65,66,82,51,68,84,85,70,71,87,88,80,91,74, \
\ 4,121,98,67,83,100,101,86,102,103,104,105,7,7, \
\ 5,6,99,9,8,26,58,42,122
REM Relative widths:
Width() = 1,1,1,1,1,1,1,1,1,1,1,1,1,2.0, \
\ 1.5,1,1,1,1,1,1,1,1,1,1,1.15,1.15,1.2, \
\ 1.8,1,1,1,1,1,1,1,1,1,1,1,1,0, \
\ 1.3,1,1,1,1,1,1,1,1,1,1,1,2.7,0, \
\ 1.0,1.0,7.0,1.0,1.0,1,1,1,1
REM Relative heights:
Height() = 0.9 : Height(1,13) = 1.9
SIZE = 100
VDU 5
REPEAT
y = 550
FOR r% = 0 TO DIM(Legend$(),1)
x = 50
FOR c% = 0 TO DIM(Legend$(),2)
IF Width(r%,c%) <> 0 THEN
w = Width(r%,c%) * SIZE - 10 : h = Height(r%,c%) * SIZE
IF INKEY(-InKey%(r%,c%)) GCOL 2,14 ELSE GCOL 1,5
RECTANGLE FILL x, y, w, -h
W% = LEN(Legend$(r%,c%)) * 16
MOVE x + (w - W%) DIV 2, y - SIZE DIV 2 + @char.y%
GCOL 15 : PRINT Legend$(r%,c%);
x += Width(r%,c%) * SIZE
ENDIF
NEXT
y -= SIZE
NEXT r%
delay% = INKEY(10)
UNTIL FALSE