Gamepad not working with HTML5 target



  • flixel: [4.3.0]
    lime: [2.9.1]
    openfl: [3.6.1]

    Gamepad works with neko, but doesn't with html5

    When I do a trace(FlxG.gamepads); I get:

    Levels.hx:128: {
    activeGamepads : [],
    gamepads : [],
    hx__closures
    : {
    65 : <function>,
    66 : <function>
    }
    }

    Gamepad is logitech RumblePad 2, browser is chromium 62.0.3202.89 on Debian 9.2 (64-bit)

    Gamepad works here : http://html5gamepad.com/

    ss

    Is this a known problem with flixel: [4.3.0] + lime: [2.9.1] + openfl: [3.6.1] ?

    Should I downgrade to a version where gamepads actually work for html5 ?

    Thx for reply

    EDIT:

    The flixel-demo "GamepadTest" works in neko, but doesn't in HTML5

    In HTML5 it says "No gamepad detected" or something like that



  • This post is deleted!


  • @jul2000 UPDATE

    So, it appears that if I replace

    			if(data.mapping == "standard") {
    				cache.isGamepad = true;
    			}
    

    By

    				cache.isGamepad = true;
    

    In ,updateGameDevices: function()

    alt text

    The gamepad gets recognized

    Left axis/analog stick works as expected, not buttons, they are messed up (basically right stick becomes jump button, on neko button 2 is jump button)

    Oddly , the directional arrows work too, by pushing the "mode" button, which does nothing normally when exported to neko (in that case analog stick and directional arrows both work at the same time)

    As a reminder, this is my pad alt text Logitech RumblePad 2, pretty standard

    Any idea how I can fix that from AS3/Haxe code instead of directly modifying it in the HTML5 code ?



  • @jul2000 So I ended up hacking my way out of this in an absolutely fucken horrible way, but now I get gamepads inputs working with html5 build, completely messed up inputs when it comes to buttons, but the directional pad and stick work as expected

    It came from lime 2.9.1

    So I basically went to haxelib/lime/2.9.1/lime/_backend/html5/HTML5Application.hx and added

    cache.isGamepad = true;
    

    right after

    if (data.mapping == "standard") {
    				
    	cache.isGamepad = true;
    
    }
    

    on line 394

    Now I need to hack my ingame gamepad controls specifically for html5 target and I'm not even sure the buttons will somehow get detected or if that will be even remotely consitent with different gamepads

    Sad

    Edit: In order to make it work properly (buttons) I have to change model from LOGITECH to XINPUT

    if (FlxG.gamepads.lastActive != null){
    
    	FlxG.gamepads.lastActive.model = FlxGamepadModel.createByName("XINPUT");
    
    }
    

    Edit: Sad


Log in to reply
 

Looks like your connection to HaxeFlixel was lost, please wait while we try to reconnect.