JInput and Steam overlay

Hi all!

We are integrating steam support into Caromble! and we are running into a bit of trouble that we can’t find a way around ourselves.

The problem is that after the Steam Overlay has been active, we are no longer getting any input into our game.

We are using JInput for the input handling.

Our current work-around involves restarting JInput every time we don’t get input for a few seconds. The downside of this approach is that this makes the windows plugin a bit unstable (i.e. it starts missing some input). We could theoretically patch the windows client for our situation, but I fear that would only lead to more similar fixes for the other platforms we support. And also it feels like a bit of a nasty hack.

So here’s my question. Does anyone have experience with the Steam Overlay and getting the focus back to the game? Any clue what else we could try??

Thanks!

Just wanted to say, we fixed the bug ;D. Or worked around it actually…

I’ll post it here, maybe it helps someone else.

The problem is with the Raw input plugin for windows. Luckily, you can disable it:


AccessController.doPrivileged(new PrivilegedAction<Object>() {
        public Object run() {
            String os = System.getProperty("os.name", "").trim();
            if (os.startsWith("Windows")) {  

                // disable default plugin lookup
                System.setProperty("jinput.useDefaultPlugin", "false");

                // set to same as windows 7 (tested for windows 8 and 8.1)
                System.setProperty("net.java.games.input.plugins", "net.java.games.input.DirectInputEnvironmentPlugin");

            }
            return null;
        }
    });