Hold It

BlitzMax Forums/BlitzMax Beginners Area/Hold It

dw817(Posted 2016) [#1]
I was using maxgui.drivers() to generate a frameless window, now I'm running into another problem.

While I have a fairly good routine I wrote to handle reading keys, I am finding there is no way of easily determining if a key is HELD DOWN. That is, normally you would use:

if keydown(key_left) then x:-4

Instead by using maxgui CreateWindow(), keydown() can no longer be read.

I know I can use PollEvent(), CurrentEvent.ID, event_keydown, event_keyup, event_keyrepeat, but there is not one for (as near as I can tell), event_keyheld (which turns to zero once you let go of the key).

My question (and likely it is a beginner's one) Is there some way to tweak the system to allow keydown() again or some command or function I'm not familiar with that will give me the equivalent of keydown() - and to put it back in to activation ?

Or ... failing that, a remarkably easy way to remove the standard border that accompanies any graphics () command. That would actually be more desired, then I won't have to use maxgui.drivers() at all and will have keydown() fully available for use.


Kryzon(Posted 2016) [#2]
Yeah, you can read these posts I wrote to you, for that exact purpose you described:

- http://www.blitzbasic.com/Community/posts.php?topic=105463#1284913
- http://www.blitzbasic.com/Community/posts.php?topic=105463#1286356


dw817(Posted 2016) [#3]
Ah, nailed it ! I just needed this one line of code:

EnablePolledInput()

Checking keyboard, now active, checking mouse, now active. That's the lot of it !

I think I'm in the right area as that was indeed a simple answer for what I needed, many thanks, Kryzon !!

I'll post a new updated Key Reader routine once I get all that nasty PollEvent() code outta there.