You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to detect mouse clicks, the GWT module does not map the proper button clicks:
if (Gdx.input.isButtonJustPressed(Input.Buttons.RIGHT)) is actually triggered on left-click.
if(Gdx.input.isButtonJustPressed(Input.Buttons.MIDDLE)) is actually triggered on right-click.
if(Gdx.input.isButtonJustPressed(Input.Buttons.LEFT)) is not triggered through left-click, right-click, nor middle-click.
Reproduction steps/code
Try this piece of code to reproduce the issue. Via the DesktopLauncher it will work as expected, but when tried via the browser (after using dist and superDev html build tasks), it will behave as described above.
Version of LibGDX and/or relevant dependencies
1.9.10
Please select the affected platforms
HTML/GWT is the only platform I've seen this bug occur on so far.
The text was updated successfully, but these errors were encountered:
payne911
changed the title
GWT module does not map the proper Input.Buttons
GWT module does not map the proper Input.ButtonsOct 2, 2019
This is a real bug; it looks easy enough to fix. GwtInput has a getButton() method that remaps a constant from GWT's NativeEvent to the constants in libGDX's Input.Buttons. Take a look at
; one usage relating to the just-pressed buttons only uses the NativeEvent codes, and doesn't remap. This means @payne911 could either use NativeEvent's constants on GWT only (not any other platform), which seems bad but maybe necessary, or we could fix this by changing line 592 in GwtInput.java to call getButton() on the event's code from its own getButton() method (like on line 591).
mgsx-dev
added a commit
to mgsx-dev/libgdx
that referenced
this issue
Oct 2, 2019
Issue details
When trying to detect mouse clicks, the GWT module does not map the proper button clicks:
if (Gdx.input.isButtonJustPressed(Input.Buttons.RIGHT))
is actually triggered on left-click.if(Gdx.input.isButtonJustPressed(Input.Buttons.MIDDLE))
is actually triggered on right-click.if(Gdx.input.isButtonJustPressed(Input.Buttons.LEFT))
is not triggered through left-click, right-click, nor middle-click.Reproduction steps/code
Try this piece of code to reproduce the issue. Via the
DesktopLauncher
it will work as expected, but when tried via the browser (after usingdist
andsuperDev
html build tasks), it will behave as described above.Version of LibGDX and/or relevant dependencies
1.9.10
Please select the affected platforms
HTML/GWT is the only platform I've seen this bug occur on so far.
The text was updated successfully, but these errors were encountered: