Events, Polledinput, forcing a KeyDown() etc

BlitzMax Forums/BlitzMax Programming/Events, Polledinput, forcing a KeyDown() etc

Damien Sturdy(Posted 2007) [#1]
Hi All,

We're having a problem getting KeyHit(), Keydown() etc to work outside of Graphics() and MaxGUI. Our wrapper is spawning its own window and we'd like to be able to pipe keydown() and polledinput in general to work with it.

So far the wrapper will work with MaxGUI or in its own window. PolledInput works on the GUI canvas but of course does not in a spawned window.

We need to provide this functionality.

Any ideas on where to start? Inserting the events using PostEvent don't seem to do much!

OK, again, so the simple question is, how do I get polledinput() and Keydown() etc functions working in a non-Graphics and non-MaxGUI window?

Any tips and code would be helpful!

Thanks!


Jake L.(Posted 2007) [#2]
You've tested EnablePolledInput(), did you?

Another way would be to implement input by yourself (install own system-eventhandler, could be hard to make this crossplatform). E.g. under windows you should be able to simulate keystrokes with SendMessage().


Damien Sturdy(Posted 2007) [#3]
Actually, i just went deep into Max and took a bit of source code from under "private" and recoded it in our wrapper.

Effectively I just ported a version of PolledInput to work on an Ogre window created in Max.

Yes tried EnablePolledInput, and we are already sending the events, max' polledinput just doesnt pick them up.


Damien Sturdy(Posted 2007) [#4]
Update on this:

We had to take the BRL PI source, and code it into our own application with modifications so that it would call BRL's polled input whenever our own Graphics system was not used, but calls our own routines when our Graphics system IS used.

Thing is, I shouldn't have to do this right? Why can't I enable BRL.Polledinput to work on a non Blitz and non maxGUI created Window?


skidracer(Posted 2007) [#5]
I think you need to call bbSystemEmitOSEvent from your ogre wndproc (#include brl.mod/system.mod/system.h).


Damien Sturdy(Posted 2007) [#6]
Thanks skid, i'll look at that!

[edit]


Woah.... im trying to follow this code, really. ^.^

*jump jump jump jump jump* :)