Keydown / modifiers in 1.12
BlitzMax Forums/BlitzMax Programming/Keydown / modifiers in 1.12
| ||
' keydown.bmx ' the following code draws a circle if the ' program detects the spacebar is pressed ' and exits when it detects the ESCAPE key has ' been pressed Graphics 640,480 While Not KeyHit(KEY_ESCAPE) Cls If KeyDown(MODIFIER_CONTROL) DrawOval 0,0,640,480 Flip Wend This code should work, right? For some reason it doesn't seem to.. What am I doing wrong? This is in bmax 1.12 on OS X 10.4.3 (grumbles about general bmax dysfunctionality) |
| ||
This seems to work:' keydown.bmx ' the following code draws a circle if the ' program detects the spacebar is pressed ' and exits when it detects the ESCAPE key has ' been pressed ' DrawOval only seems to work if I set a specific graphics driver ' but DrawRect() works without seting a graphics driver ????? SetGraphicsDriver GLMax2DDriver() '<<<<< comment this out to test! Graphics 640,480 While Not KeyHit(KEY_ESCAPE) Cls If KeyDown(KEY_SPACE) Then SetColor 255,255,0 DrawOval 50,50,100,100 SetColor 0,0,255 DrawRect 250, 50, 50, 50 End If Flip Wend DrawOval()only seems to work if I set a specific graphics driver but DrawRect() works without seting a graphics driver? |
| ||
From the MAXGUI documentation:The MODIFIER_COMMAND value should be used instead of MODIFIER_CONTROL with Menu hotkeys for best crossplatform compatability. This is mentioned in the CreateMenu:TGadget() doc, but I guess it means that something has changed in how BMax handles modifier keys... |
| ||
From what I can see the MODIFIER_ stuff is for GUI gadget hotkeys only. For KeyDown stuff you should use KEY_LCONTROL or KEY_RCONTROL (the more generic KEY_CONTROL seems to have vanished). Lookup CreateMenu in the help. |
| ||
Thanks happycat :D |