Canvas simultaneous keypresses
BlitzMax Forums/MaxGUI Module/Canvas simultaneous keypresses
| ||
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? |
| ||
For the moment, I do things the same way: store key states (and also mouse states for that matter!) into variables or arrays. |
| ||
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: |
| ||
Works a treat. Thanks Simon. |
| ||
Simon excelent demo dose'nt work under Linux! |
| ||
I just tried this under Ubuntu Linux 7.04 and it works okay. |
| ||
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) |