Spodii / netgore

Cross platform online rpg engine using C# and SFML
http://www.netgore.com/
40 stars 16 forks source link

Double SFML input (two clients share input) #336

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Open two clients side-by-side (double monitor or just keep a look out somehow)

Press Control or an Arrow Key; listen or look as both clients move at the same 
time despite lack of focus on the other. 

This is useful for debugging locally

Original issue reported on code.google.com by hilts.va...@gmail.com on 5 Feb 2013 at 7:03

GoogleCodeExporter commented 9 years ago
I've known about this for a while. It's not really a double client issue, but 
rather, the client needs to be changed to only allow/process controls when the 
client has focus.

Original comment by darksumm...@gmail.com on 5 Feb 2013 at 9:19

GoogleCodeExporter commented 9 years ago
Just to clarify - the issue right now is that the client handles input even 
when it isn't focused? What about when you have something completely different 
focused, like Explorer or a browser? If it still handles input, that isn't 
good. It should only handle input while it has focus.

I did a quick check through SFML's classes, and surprisingly didn't see any 
property for determining if the screen has focus. But this can probably still 
be done using the GameForm form - I think that will work for fullscreen as well.

Original comment by Spodiii on 5 Feb 2013 at 5:21

GoogleCodeExporter commented 9 years ago
This is correct Spodi and no, it isn't good. It's been on my TODO list for a 
while now but haven't gotten around to it.

Original comment by darksumm...@gmail.com on 5 Feb 2013 at 5:37

GoogleCodeExporter commented 9 years ago
I had another little look and in the GameForm class you can override the 
OnGotFocus and OnLostFocus methods (not sure if this is actually what we want 
since it isn't SFML) but I'm not sure what code to even add. I can see the 
command key processing but not the actual keyboard game controls..any 
suggestions? Thanks :).

Original comment by darksumm...@gmail.com on 5 Feb 2013 at 10:34

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r4731.

Original comment by hilts.va...@gmail.com on 6 Feb 2013 at 4:31