Canvas simultaneous keypresses

BlitzMax Forums/MaxGUI Module/Canvas simultaneous keypresses

impixi(Posted 2006) [#1]
I was wondering how others are handling multiple, simultaneous keystrokes on a MaxGUI canvas.

Here's my attempt:



Is there a simplier, more obvious approach?


CS_TBL(Posted 2006) [#2]
For the moment, I do things the same way: store key states (and also mouse states for that matter!) into variables or arrays.


skidracer(Posted 2006) [#3]
The undocumented (unfortunately) command enablepolledinput should enable you to use standard KeyDown commands with a canvas or active panel.

Note the use of waitevent instead of pollevent so your app doesn't run with 100% cpu usage:




impixi(Posted 2006) [#4]
Works a treat. Thanks Simon.


Nigel Brown(Posted 2006) [#5]
Simon excelent demo dose'nt work under Linux!


impixi(Posted 2007) [#6]
I just tried this under Ubuntu Linux 7.04 and it works okay.


LAB[au](Posted 2007) [#7]
I had to change this line (winXP) for this to work...

Global GameCanvas:TGadget = CreateCanvas(0, 0, 0, 0, MainWindow)

to

Global GameCanvas:TGadget = CreateCanvas(0, 0, 10, 10, MainWindow)