-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Manjaro Linux: Input.is_action_pressed() receives axis key when user touches right edge of laptop trackpad #84161
Comments
Hey folks, I understand such a random issue may be difficult to diagnose by just description. So, if you requires logs or operations to help diagnose, please kindly let me know. I may not be able to response immediately due to time zone difference but will reply in 1-2 days. |
Hei, Can you confirm that when the "ghost hand" happens, it hits the _physics_process but not the ui_right / left logic? |
Hi Dorin @d0x1n, I may not fully understand your meaning of ui_left/ left logic. But if you mean whether Input.is_action_pressed() API returns value, then yes, it does. My code snippet is pasted below. I added two print() lines for debugging purpose. The move_left and move_right variables immediately calls Input.is_action_pressed(), at the first two statements of _physics_process(). When the issue happens, the "move left" and "move right" messages are printed continuously. That means, _physics_process() is invoked, and then it calls Input.is_action_pressed() API. Meanwhile, the Input.is_action_pressed() API keeps returning true when keyboard is not touched. Or, if you mean something in C++ layer, could you help providing some steps so I can log it? My minimal project code path: https://github.com/fuzhouch/interactive-space-tour/blob/main/characters/Player.gd EDIT 20231030: You can also see my hands are completely off left/right arrow keys of keyboard, which are "ui_left" and "ui_right".
|
There are some problems that invalidate what you said:
Focusing on the problem, note that ui_right has 3 possible input types, D-Pad, Left Stick Right and Right key. So it may not be a problem with Godot, but rather with your keyboard or other software that activates the "D-Pad" or "Left Stick Right" To create a minimal example, simply create your own actions, isolating the roads into different actions, like this: And create a single scene with "_process" printing the active keys, example:
To make things easier, I created a minimal (really minimal 😁) example that you can test and confirm which one is actually being activated (D-PAD or Axis): Once you test the example I sent you, get the results in the godot console and update the "issue".
|
Hi @brcontainer, Thanks for your inputs. Let me try and get back to you. Just to be clear on some points you made.
Anyway, let's do this: Let me create a project based on your Majaro-Input.zip, and make sure there's configuration only on keyboard. I will record a video and get back to you. |
Hey @brcontainer, You are right, appears it's a problem on joystick input. (Thanks!) I uploaded your minimal project to Github (https://github.com/fuzhouch/manjaro-input) and did a quick try on my machine. To make sure the enviornment clean I managed to do the following:
The result is shown as video: https://www.veed.io/view/f299612c-5b6e-429e-852a-85db12870a0d?panel=share A summary below:
So to answer the possible directions you pointed out:
Btw, what confused most is Godot 3.5.3 does not have this issue (I created a minimal project just like yours for Godot3). To be honest, that's actually the biggest reason I think it a Godot 4 bug instead of system configuration bug. I was thinking Godot 3 and 4 should have similar input handling logic, but I can be wrong since I'm not expert on input logic. Could you suggest any next steps? |
I strongly suspected some sort of a joystick issue and/or broken joystick drivers from the description. I vaguely remember someone having superfluous inputs due to having a joystick plugged in/the joystick/touchpad drivers misbehaving Similar issue #62598 (but they had inputs dropped not superfluous inputs appearing) and #16832 (receiving joystick when not focused) |
Thanks @Zireael07. If I want to verify your theory, could you suggest a possible start point, e.g. which kernel module I need to check or udev rules? What information I should collect to help diagnose, e.g. dmesg output? This is the first time I started touching this area, so any starting point is greatly appreciated. I checked and confirmed I didn't install any thirdparty drivers from either source or AUR. Meanwhile, if it's a driver issue, there may be two more questions:
|
Ah, I missed the fact that 3.5 works fine There was a ton of changes in Godot around input and joysticks specifically - this looks like a regression then As for 2) that's exactly what a broken driver can do. Another possible culprit is your laptop touchpad, which can also be picked up as a joystick by SDL and can send superfluous events |
Thanks @Zireael07. I am just replying. If I want to verify it's caused by a bad driver, could you suggest a possible start point, e.g. which kernel module I need to check or udev rules? What information I should collect to help diagnose, e.g. dmesg output? This is the first time I started touching this area, so any starting point is greatly appreciated. Btw, I checked and confirmed I didn't install any thirdparty drivers from either source or AUR. |
Btw, I would like add one more context - I don't think I see less frequency on Godot 3 because I don't use it often. In fact, I uses Godot 3 more often than 4 on my machine. Godot 3 is my main work system for my game, Tsetesg's Adventure which just released until last week. I just started working heavily on Godot 4 since last week, because I need to port my game from 3 to 4. Then I was bugged by the issue. |
Oh I forgot one thing -- I actually did try to identify whether this is a driver problem. Yesterday I switched between three kernels, 5.5, 5.6 and 5.1. Same issue happens on all kernels after reboot. |
And you also made a mistake when writing the IFs (https://github.com/fuzhouch/manjaro-input/blob/e9dd79504421085ffe676a5e49ae88261b340f3c/mcve.gd#L12):
Should be:
After correcting MCVE, test and see if it is indeed the Axis that is being fired randomly, then update the ISSUE title. Will your game only run on computers? If it's only going to run on computers or browsers, then you won't need the axis or the d-pad (if the intention is to just use the standard keyboard), then configure your own input actions, this will temporarily solve the problem. I personally never use the builtin actions (with ui_ prefix), as I prefer to configure the project manually instead of using something that may change in the future. |
Hi @brcontainer Oh you are my hero! Thank for pointing out -- Corrected and here you go - https://www.veed.io/view/1152ba86-e6c4-4ff1-8d5f-54f81afcc103?panel=share It's on the same setup - Shutdown Bluetooth, close Steam, no other services like KDE Connect. From the output result it seems the only ghost is from axis-0-plus, no d-pad-right. So looks like d-pad is safe.
Unfortunately the answer is no. The only reason I migrate from Godot 3.5.3 to Godot 4 is to port my game to Nintendo Switch. Running on Godot 4 is a requirement from my publisher. Btw, I used to think this issue low priority, as Switch does not have keyboard. But now it appears to be a bigger issue to me, because D-pad/axis support is a must when I deliver the game. And axis seems more important due to Switch's gamepad layout.
Same with you. My project also defines my own input definitions (see screenshot below). But has you see, the issue can be reproduced on all three projects, no matter what name is. |
Hi folks, @brcontainer @Zireael07 @d0x1n , I suddenly get a new finding that should narrow down the investigation. The issue can be stably reproduced. The trick is, when I scroll the right edge of trackpad, it generates axis input. If I click any part of the trackpad, the input stops. I've uploaded a new video to show it: https://www.veed.io/view/a427a61e-b231-4390-a5d3-701ba921072b?panel=share That explains why I hit it so frequently. During development I mostly use keyboard on my laptop to play. I set key to WSAD (direction) and JKL (hide,fireball and jump). With this setting, my palm usually touches right edge of trackpad. Then the axis input is generated. So @Zireael07 made a point that closesd to root cause. Why does Godot 4 treats trackpad as axis? Especially, I use double finger scrolling in my Gnome desktop. And one more thing -- even when debug window does not grab focus, it still receives axis input. Morever, I also tried it in Godot 3.5.3 by mimicing @brcontainer 's Manjaro-Input project. Godot 3.5.3 does not respond to the right-edge scrolling at all. Is it a design change btw 3 and 4? |
Ok, now update the issue title, to explain that the problem is with "Joypad Axis", and let's wait for the next investigations. |
@fuzhouch I downloaded Godot3.5 and noticed a difference in the ui_right action:
In other words, this is probably why you didn't notice the problem in Godot3, because it wasn't configured to use Axis. I created an MCVE for you to test in Godot3 on your Manjaro, test it and tell us if Axis is also printed in the Godot Console: |
Sure, man @brcontainer, but this time I don't agree with you. :( I have already verfied on a mimic app mentioned before for Godot 3.5.3. The code is uploaded to Github as well: https://github.com/fuzhouch/manjaro-input-3. As you suggested long ago, I have stopped using ui_* in all tests mentioned above, but created settings to mimic your manjaro-input.zip project. Since you asked, I created two videos to compare the result. You should be able to see the two IDEs are running on same laptop at same time. Godot 3.5.3: https://www.veed.io/view/98a03642-dbcf-4715-80cf-fb03ab1a77c6?panel=share With the clips we can clearly see Godot 3.5.3 does not receive axis-0-plus event, while Godot 4 still receives when I slide my fingers on right edge of trackpad. |
The process of elimination exists in different contexts, such as mathematics, medicine, and the judiciary. In simple terms, this process that I have applied so far is what helped to detect that the problem is specifically in Axis and the last test I sent you is precisely to confirm whether it is a Godot4 bug or an external factor. As I said:
It probably indicates a possibility, this is not even a statement of fact. That's why I asked you to test the Godot3 MCVE that I created. It was thanks to the last test that we were able to verify the possible problem with Godot4. 👍👍👍 |
No problem I totally understand. Thanks for keeping the feedbacks to me. Btw, just curious, is it possible that other folks to reproduce this issue? I'm afraid it's unreasonable to diagnose via video. |
@fuzhouch I couldn't reproduce the problem, I'm trying a different technology than Godot to create another MCVE to send you, something that captures any input, so we can identify which input on your Manjaro is accidentally mapped to the same as the "Joypad Axis". Basically it's a script that will capture everything related to the inputs executed on your Manjaro, I'm still coding, it may take some time. |
@brcontainer I see. Just take your time. And a quick note - I will be out tomorrow for meeting. So response may be slow in the next day. Just send me script when you are ready. I will get back to you ASAP. |
Hey folks, I believe I can confirm this issue is a dup of known issue, #59250. By printing all my input devices and events from my local machine, I can confirm my Trackpad is recognized by Godot 4 as a gamepad with device ID == 0. I also found a workaround from the original report (Thanks @vysker). @brcontainer Let's close this issue. The fix should have been in master branch already. Let's wait for upcoming version for an official fix. |
Godot version
4.1.2.stable.flathub [399c9dc]
System information
Manjaro Linux unstable rolling version, Gnome w/ Wayland (Help > Copy System Info output: Godot v4.1.2.stable (399c9dc) - Freedesktop SDK 23.08 (Flatpak runtime) - Wayland - Vulkan (Compatibility) - Mesa Intel(R) Xe Graphics (TGL GT2) () - 11th Gen Intel(R) Core(TM) i5-11320H @ 3.20GHz (8 Threads)
Issue description
Expected behavior
When I run my game within Godot IDE on Linux + Gnome desktop, the running game accepts keyboard input ("ui_accept" for jump, "ui_left" and "ui_right" for moving) to control character move. The character should stay if there's no input. It should only move when ui_left o ui_right key is pressed.
Actual behavior
At a random chances I can see the character moves when my hands leave keyboard, as if a ghost hand is pressing my keyboard. It can't be reproduced every time but happens in a relatively high frequency. In my experience the frequency is 1 hit per 3-5 launches.
When the ghost input happens, switching window focus does not solve this issue.
I tried to print return value of Input.is_key_pressed("ui_left") and Input.is_key_pressed("ui_right"). The output is true when the issue happens.
As it sometimes works completely fine, I can't exactly tell how it's reproduced in 100% stable rate. An observation is it can be triggerred quickly when I moves my finger on touchpad, either multi-finger move (flip desktop) or single-finger move.
A recorded example video is uploaded at: https://www.veed.io/view/9d6cb6c1-0607-4b45-a3c1-a5e990e578f1
Additional scenarios
Additional information
OS: Manjaro Linux unstable (rolling build)
X11: package = libx11, version: 1.8.7-1
Wayland: package = wayland, version = 1.22.0-1
Steps to reproduce
Minimal reproduction project
My project (GDScript-based): https://github.com/fuzhouch/interactive-space-tour
The all character moving logic is in Player.gd
The text was updated successfully, but these errors were encountered: