Control(0).Label = "UP": Control(0).Value = 18432: Control(0).JoyStick = 1210000
Control(1).Label = "DOWN": Control(1).Value = 20480: Control(1).JoyStick = 1220000
Control(2).Label = "LEFT": Control(2).Value = 19200: Control(2).JoyStick = 1120000
Control(3).Label = "RIGHT": Control(3).Value = 19712: Control(3).JoyStick = 1110000
Control(4).Label = "SELECT": Control(4).Value = 8: Control(4).JoyStick = 1000000
Control(5).Label = "TAB": Control(5).Value = 9: Control(5).JoyStick = 1000001
Control(6).Label = "ENTER": Control(6).Value = 13: Control(6).JoyStick = 1000002
Control(7).Label = "CANCEL": Control(7).Value = 27: Control(7).JoyStick = 1000003
Settings
SCREEN _NEWIMAGE(640, 480, 32) 'And a second screen, so we can see that we scale to fit any environment properly Settings
DIM BackUp
(10) AS Control_Type
FOR i
= 0 TO 10: BackUp
(i
) = Control
(i
):
NEXT
BGC = SkyBlue 'Background color
Button = BoxImage(300, 50, 5, BT, Ivory)
Frame = BoxImage(300, 50, 5, 0, Red)
CenterLabel 200, 10, 300, 50, "Keyboard"
CenterLabel 600, 10, 300, 50, "JoyStick"
CenterLabel 200, 60 * i + 71, 300, 50, GetKeyName(Control(i).Value)
CenterLabel 600, 60 * i + 71, 300, 50, GetKeyName(Control(i).JoyStick)
Accept = BoxImage(200, 200, 5, Green, Ivory)
Cancel = BoxImage(200, 200, 5, Red, Ivory)
CenterLabel 1000, 100, 200, 200, "OK"
CenterLabel 1000, 400, 200, 200, "Cancel"
replace = -1: j = -1: OM = -1
FOR i
= 0 TO 10: Control
(i
) = BackUp
(i
):
NEXT OM = MB
k = 1000000 + i * 100000
replace = i
_PUTIMAGE (200, 60 * i
+ 70), Button
, tempimage
_PUTIMAGE (200, 60 * i
+ 70), Frame
, tempimage
Control(replace).Value = k
_PUTIMAGE (200, 60 * replace
+ 70), Button
, tempimage
CenterLabel 200, 60 * replace + 71, 300, 50, GetKeyName(k)
replace = -1
IF Control
(i
).JoyStick
= k
THEN j = i
_PUTIMAGE (600, 60 * i
+ 70), Button
, tempimage
_PUTIMAGE (600, 60 * i
+ 70), Frame
, tempimage
Control(j).JoyStick = k
_PUTIMAGE (600, 60 * j
+ 70), Button
, tempimage
CenterLabel 600, 60 * j + 71, 300, 50, GetKeyName(k)
j = -1
FUNCTION BoxImage
(wide&
, tall&
, thick&
, BGcolor&&
, FrameColor&&
) IF BGcolor&&
= -1 THEN BGcolor&&
= 0 LINE (i&
, i&
)-STEP(wide&
- i&
* 2, tall&
- i&
* 2), FrameColor&&
, B
SUB CenterLabel
(left&
, top&
, wide&
, tall&
, text$
) bx = (wide& - pw) \ 2: by = (tall& - fw) \ 2
CASE 8: GetKeyName$
= "BKSP" CASE 9: GetKeyName$
= "TAB" CASE 13: GetKeyName$
= "ENTER" CASE 27: GetKeyName$
= "ESC" CASE 32: GetKeyName$
= "SPACE" CASE 15104: GetKeyName$
= "F1" CASE 15360: GetKeyName$
= "F2" CASE 15616: GetKeyName$
= "F3" CASE 15872: GetKeyName$
= "F4" CASE 16128: GetKeyName$
= "F5" CASE 16384: GetKeyName$
= "F6" CASE 16640: GetKeyName$
= "F7" CASE 16896: GetKeyName$
= "F8" CASE 17152: GetKeyName$
= "F9" CASE 17408: GetKeyName$
= "F10" CASE 34048: GetKeyName$
= "F11" CASE 34304: GetKeyName$
= "F12" CASE 18432: GetKeyName$
= "" CASE 19200: GetKeyName$
= "" CASE 19712: GetKeyName$
= "" CASE 20480: GetKeyName$
= ""
CASE 18176: GetKeyName$
= "HOME" CASE 18688: GetKeyName$
= "PG UP" CASE 20224: GetKeyName$
= "END" CASE 20736: GetKeyName$
= "PG DOWN" CASE 20992: GetKeyName$
= "INS" CASE 21248: GetKeyName$
= "DEL"
CASE 100019: GetKeyName$
= "PAUSE" CASE 100300: GetKeyName$
= "NUM LOCK" CASE 100301: GetKeyName$
= "CAPS LOCK" CASE 100302: GetKeyName$
= "SCROLL LOCK" CASE 100303: GetKeyName$
= "R SHIFT" CASE 100304: GetKeyName$
= "L SHIFT" CASE 100305: GetKeyName$
= "R CTRL" CASE 100306: GetKeyName$
= "L CTRL" CASE 100307: GetKeyName$
= "R ALT" CASE 100308: GetKeyName$
= "L ALT" CASE 100309: GetKeyName$
= "L APPLE" CASE 100310: GetKeyName$
= "R APPLE" CASE 100311: GetKeyName$
= "R WIN" CASE 100312: GetKeyName$
= "L WIN" CASE 100316: GetKeyName$
= "SYSTEM" CASE 100319: GetKeyName$
= "MENU" GetKeyName$
= "JB #" + _TRIM$(STR$(code
- 999999)) CASE 1110000: GetKeyName$
= "AX 1+" CASE 1120000: GetKeyName$
= "AX 1-" CASE 1210000: GetKeyName$
= "AX 2+" CASE 1220000: GetKeyName$
= "AX 2-" CASE 1310000: GetKeyName$
= "AX 3+" CASE 1320000: GetKeyName$
= "AX 3-" CASE 1410000: GetKeyName$
= "AX 4+" CASE 1420000: GetKeyName$
= "AX 4-" CASE 1510000: GetKeyName$
= "AX 5+" CASE 1520000: GetKeyName$
= "AX 5-" CASE 1610000: GetKeyName$
= "AX 6+" CASE 1620000: GetKeyName$
= "AX 6-" CASE 1710000: GetKeyName$
= "AX 7+" CASE 1720000: GetKeyName$
= "AX 7-"