xbox controller not working on webview2 export latest build

Not favoritedFavorited Favorited 1 favourites
From the Asset Store
Small pixel icons for the 3 most popular controller types.
  • I just want to update this thread with the latest from the r472 release. Unfortunately we have been waiting for some time now for the underlying WebView2 bug to be fixed. To help get us by for the time being until it is fixed, there is a new workaround in r472 for Steam games: the Gamepad plugin now includes a wrapper extension (scirra-gameinput-x64.ext.dll) to directly read gamepad input from the modern Windows GameInput API and send the inputs to JavaScript bypassing WebView2. Essentially it's our own custom C++ implementation of gamepad input to work around this issue.

    For non-Steam games, you can still use the workaround described earlier in this thread: add "allow-host-input-processing": false to package.json, and also delete scirra-gameinput-x64.ext.dll from the exported files, since if it exists it will use the GameInput workaround which has some limitations (described below). This should restore gamepad input using the fully-featured browser built-in Gamepad API.

    For Steam games you cannot set "allow-host-input-processing": false as it will break the Steam Overlay. Instead you can now use the GameInput workaround, which is used by default for all Windows WebView2 exports. GameInput should have good controller compatibility as it is a superset of all prior input APIs, covering XInput, DirectInput, Raw Input, HID, and WinRT APIs - for example I have successfully tested both Xbox controllers and a PS4 controller (which was not historically supported out-of-the-box on Windows). Note however the GameInput workaround currently has a couple of limitations:

    • Due to a GameInput bug currently only a single gamepad is supported. Input from multiple gamepads simultaneously is not supported when using GameInput - the only active gamepad will be the last connected one.
    • Haptic feedback (rumble) is not currently supported
    • GameInput should work out-of-the-box on some Windows systems, but you need to install the GameInput redistributable installer to guarantee support. This can be made part of the install process for Steam.

    To get the GameInput redistributable installer, download the GameInput NuGet package (click 'Download package' on the right), rename .nupkg to .zip, open the zip, and extract redist/GameInputRedist.msi. This is the file that needs to be run as part of an install process (or locally for testing purposes) to ensure GameInput support is available.

    GameInput diagnostic messages are logged to the browser console, so you can check there to see the status (such as whether it loaded OK and which devices its detected, or any error messages).

    Remember if you test with app ID 480 (Space war) you may need to disable Steam Input in its settings until you get your own app ID. (This is just because of the configuration of Space war and isn't really anything to do with GameInput.)

    I appreciate GameInput isn't as straightforward as using the built-in support but the idea is this will provide basic support for gamepad input until the WebView2 issue is fixed, at which point we can delete all the GameInput code and just go back to using standard browser-based Gamepad API input like everything else uses, and then we won't have to worry about any of this. So hopefully this helps in the mean time.

  • Thanks for informing us Ashley, and for the workaround! Very odd that it only detects the single gamepad input.

    The problem is actually that sometimes it detects a single physical gamepad as two gamepads, in a way that is impossible to distinguish from actually connecting two gamepads. So until they fix that, there's no way to tell apart one gamepad incorrectly appearing as two gamepads, or actually having two gamepads. Our workaround is to only support the last connected gamepad so this doesn't cause a problem.

  • As we're probably going to be supporting this workaround for a while, there are a couple more changes in r473 to try to make gamepad support work better in Windows WebView2 exports. There's a new 'Export for Steam' setting for the Windows WebView2 exporter. This does the following:

    • Unchecked (default): sets "allow-host-input-processing": false in package.json. Gamepad input should work normally (using browser-provided gamepad input).
    • Checked: sets "allow-host-input-processing": true for compatibility with the Steam Overlay, and then includes the GameInput wrapper extension to work around the WebView2 bug that stops the browser-provided gamepad input working in this mode.

    The GameInput wrapper extension is also updated in r473 to support multiple gamepads as Microsoft were able to fix the GameInput bug that was preventing us supporting that. Note however as per the previous post, haptics (rumble) are still not supported with GameInput, and you must still install the GameInput redistributable installer to ensure support is available (be sure to use at least v3.2.138 as that has the fix allowing for multiple gamepads).

  • Nice work on this!

    Would it be possible to add a gamepad scripting interface, so it works independent of what's used internally?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Ashley > There's a new 'Export for Steam' setting for the Windows WebView2 exporter. This does the following:

    I don't see this "Export for Steam" option anywhere when choosing to export using webview2 for Windows. I'm using the latest version of Construct 3. Where should I be looking for this?

  • It was introduced in one of the recent betas.

  • It was introduced in one of the recent betas.

    Thanks very much. Found it. Now my problem is I cant get my game past the "the game needs webview 2, press here to download" when I try to run the game on my SteamDeck via Proton Hotfix. I know it worked when built from a previous version of Construct, but now it just hangs up in an infinite attempt to load webview2

  • Last I tried using Proton to run a Windows WebView2 export didn't work. Use the Linux CEF exporter instead.

  • Mike at BrashMonkey If you have issues with the official exports, there's also Pipelab which uses Electron and supports multiple platforms. It also has a good plugin with more file and Steam features.

  • Last I tried using Proton to run a Windows WebView2 export didn't work. Use the Linux CEF exporter instead.

    To say the least in my case, making a separate build specifically for Linux is not a great option. DaemonClaw (the game in question) will be 3 games in 1 package.. a construct made version, and a real Mega Drive and Neo Geo version, each running in emulation wrappers.

    So I programmed a "front end" (also in Construct) which Steam boots up, and which let's the player choose which version they way to play for that round.

    If I need to make a Linux only export, it would force me to not only export a linux version of the game itself, and the front end, but to also find a Linux based emulation wrapper for both the Mega Drive and the Neo Geo versions, so this would force an enormous amount of extra work and potential bugs specific to the different platforms, emulators, etc.

    CTHAT GPT (hopefully it's not halucinating) suggested I can pre-embed a proper compatible webview 2 to the game's proton profile in Construct, and this would circumvent the need to try to download the webview 2 on SteamDeck, which proton fails in. Does this sound possible to you?

  • Mike at BrashMonkey If you have issues with the official exports, there's also Pipelab which uses Electron and supports multiple platforms. It also has a good plugin with more file and Steam features.

    thanks for the heads up, I'll look into it, but I'd much rather find a solution without third party processes if possible. Hopefully with Ashley's help it can be done.

  • I guess you could try fixed distribution mode, but I've never tried it myself.

  • Thanks for the update (especially for the automatic addition of "allow-host-input-processing": false"), but unfortunately adding an additional installer to a Steam game isn't exactly straightforward, and I don't think it's even something players will love (they're already pretty annoyed by using Webview2, to be honest). Thanks anyway, and let's hope for an official update from Microsoft.

  • I can see the WebView team have been very slow to address this issue (as they seem to be with most issues). If the GameInput workaround is becoming more of a permanent fixture, I wonder if we could get a JS/TS API?

    Also, any news on rumble support? Is this a separate issue/being tracked?

  • NW.js was abandoned too soon, and now we're suffering the consequences. And from what I can see, it doesn't look like this is going to be fixed.

Jump to:
Active Users
There are 0 visitors browsing this topic (0 users and 0 guests)