Hey..
The event receiver only works when the game window is active/focused.
Let me explain what I want to do and why:
My game client can have up to 2 instances (for now). I coded something that let them to intercommunicate. I created a multiplayer mode (in a few words).
But you may be wondering WHY I need 2 clients instead of just one running a split screen?
Well, I have two 23" monitors connected to the system and I want that each game client instance to be visually run on each monitor. (I also have 2 joysticks).
However, the problem is:
When one client loses focus, its event receiver is "paused". So the respective player cannot send input to the game (Irrlicht does not receive them while the window is inactive).
So, is there any possibility for the engine to still get the user input while not focused?
Thanks.
Event receiver in background?
Re: Event receiver in background?
Does your EventReceiver return true or false once a case is hit? If I recall, if you have it set to... true the receiver "eats" the keypress, so nothing else can see it. Have you tried it the other way around?
The Open Descent Foundation is always looking for programmers! http://www.odf-online.org
"I'll find out if what I deleted was vital here shortly..." -d3jake
"I'll find out if what I deleted was vital here shortly..." -d3jake
Re: Event receiver in background?
It was returning false (due to the built-in FPS camera). But even when I tested the opposite the same occurred.
I don't know what I could do... I use Irrlicht a bit recently. And I also didn't find anything related in its reference pages. :/
I don't know what I could do... I use Irrlicht a bit recently. And I also didn't find anything related in its reference pages. :/
Re: Event receiver in background?
There's 2 problems here. The first is simple.. most Irrlicht examples pause running the application when it's not active. That's just that line:
The other problem is simply that keys in Windows are sent to the active window. No idea to work around that ... this is not an Irrlicht problem, Irrlicht just passes on the events it gets, this is rather something you have to solve in Windows.
Code: Select all
if (device->isWindowActive())
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: Event receiver in background?
I think you better off using a server-client model with a network library e.g. irrnet, irrnetlite or irrnetz.
Regards,
smso
Regards,
smso
Re: Event receiver in background?
Well.. It seems more complex than I thought. LoL
Thanks you guys
Thanks you guys