New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Arrow keys broken for gamepads on Android port #1074
Comments
Comment author: @rversteegen Maybe it has something to do with r6970 (17c8a7b), which changed anykeypressed: Author: teeemcee <teeemcee@7d344553-34f0-0310-a9b1-970ce8f1c3a2>
I think I see a bug! |
Comment author: @bob-the-hamster I don't know. I am seeing this in Vorpal florist which does not use an on-keypress script I haven't had a chance to figure out which revision this started in. Lately my spare time for programming almost never happens when I am in the same room as my OUYA :P As for that anykeypressed bug, which default for trigger_level is the correct one? The comments in the code make it clear what 0 and 1 mean, but not which is the appropriate default |
Comment author: @rversteegen The correct default would be whichever it was before r6970 (17c8a7b), but I don't have a copy of the source in front of me (really ought to import it to github). I'm surprised though; I was quite sure that FB threw an error if the default arguments in the function declaration and definition don't match (if they are given in both places). There were a few other changes to the keyboard and joystick input in allmodex.bas in the last 10 months. I would guess it's the changes to the joystick code which are to blame. |
Comment author: @bob-the-hamster Hmm... wait a minute... the line DECLARE FUNCTION anykeypressed (byval checkjoystick as bool = YES, trigger_level as integer = 0) as integer does not exist in my current copy of the source. the trigger_level defaults to 1 in both the .bas and .bi file. Could that be a local change on your tree? So this is probably a red herring, and unrelated to the Android gamepad bug |
Comment author: @rversteegen I actually copied those lines from the diff for that commit, rather than checking the current source. Opps! |
Comment author: @bob-the-hamster I am now reasonably confident that this is two separate unrelated bugs
D-pad input on OUYA only ever worked because OUYA uses a somewhat non-standard D-pad which apparently behaves a lot more like a constrained Analog stick. |
Comment author: @bob-the-hamster I finally had time to bisect my way through the history and find when this bug started.
This was the revision where instead of calling update_virtual_gamepad_display() after each special menu, I switched to calling it once every tick (which fixed the "Hide V. Gamepad When Suspendplayer" feature to work properly) I have not yet figured out exactly why this screws up just the arrow keys, and not the other buttons on the virtual gamepad. |
Comment author: @bob-the-hamster Okay, I have a good fix checked in for the first half of this bug. I understand why the analog stick stopped working. The code that shows/hides the virtual gamepad had to clear arrow key presses to prevent stuck keys when the shown/hidden state changed. This made the commands to show/hide the virtual gamepad unsafe to call every tick, which is exactly what revision 7449 (3d7ba3d) was doing. As for the lack of D-pad support, I will have to look into that later. |
This needs retesting. |
[sf#2015]
I am not sure when this started, but arrow key handling is totally broken on the Android port when playing with a gamepad (OUYA, Gamestick, FireTv)
This is most easily demonstrated with http://hamsterrepublic.com/tmp/inputtest-release-signed.apk
When playing inputtest on Windows/Mac/Linux or Android with the on-creen virtual gamepad, the arrow keys work as expected, turning red when pressed, or pink when held down.
When using a gamepad on an Android Console, pressing the analog stick causes the arrow keys to flicker green for a single tick, and then nothing. As for the D-Pad, it does absolutely nothing on a FireTV, and on an OUYA, the D-pad makes the arrow keys flicker green for one tick, remain dark for a few ticks, and then stay on solid green.
This definitely wasn't happening 10 months ago, so something has changed since then, but danged if I know what yet.
From: @bob-the-hamster
Reported version: 20130410 Beelzebufo
Operating system: Windows
The text was updated successfully, but these errors were encountered: