-
-
Notifications
You must be signed in to change notification settings - Fork 20.8k
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
Mouse and Keyboard doesn't work on Mobile Engine (Samsung Dex) #81890
Comments
Any updates ? Keyboard still does not work in DEX |
@VecterraSoft Does hardware keyboard/mouse work while using the internal display (i.e. when not using DeX)? |
Since I'm having the same issue, I checked some things. core/input/input.cpp:1039 - Index (int)p_button = -139 is out of bounds ((int)JoyButton::MAX = 128). This happens regardless of the focus of my application. I can type in the 2D/3D view or in a textbox, the output window will show the error message. I should also note that this is thrown twice. Once on key down and once on key up. Using it without dex works just fine. I can also confirm that the issue is not present on a fresh install of version 4.1. The playstore version (is v4.2.stable.official [46dc277] atm) does contain the issue. |
@Falor I don't know if there is any relationship, but I noticed a difference between branch 4.1 and branch 4.2. In 4.1, in script input.cpp, the part of the code that checks if a button has been pressed (line 1007) is like this:
However, in branch 4.2 (line 1022), an extra check was added:
I wonder if this is the change that caused the issue. I can't test it because I'm without Dex at the moment. |
I will look into it. The question I'd have for that, if this is actually the issue would be: Why would the keyboard input be negative or 0 when its coming through dex? That being said, I'll first need to be able to build Godot, then build it on Android to verify if that change is the cause for it. I'll post an update by the end of the week |
Yes. I plug my keyboard into my computer and use its that way and works. Then I plug Dex and on Dex it works on every app except Godot, which is why I thought it might be a godot issue. |
This is really strange and I can't imagine why, but to me, apparently Godot can identify negative inputs, and, apparently, this line is causing Godot to not identify the Dex input. It remains a strange situation. |
|
Does this mean a fix can be had? Im not too versed in godot yet, just jumped ship from LibGDX after 9 years and only been using Godot for about a month and half. So not sure what that means. |
@GuiRafaCL I can't find the code you're referring to in the |
@Calinou For some reason, the 4.2 branch is different from the master branch. In the master branch, what I mentioned is found on line 1050 in the "godot/core/input/input.cpp" directory, and is different from what I mentioned above:
I don't know what to do about this. |
If the issue was already there in 4.1.1, I doubt this changes introduced the issue. I can't really help for why it does not work, but I guess the error might come from this line:
I suspect there might be an issue with the DeX mode, where the keyboard is considered as a joypad and not a keyboard, something like that. |
Alrighty, so I set up the project and can fully test just about everything. I'm currently on the 4.3 master branch. As expected, the keyboard does not work in that version either. 4.1, I can confirm does work with keyboard and mouse. As for testing out a revert of line 1050, there is no change in the keypress result.
I am not well versed in Godot, nor fluent in C++. If you have any changes you want me to try out, I'll be able to make the changes and test them on a dex system. |
@Falor It's a shame it didn't work. Above your answer, @groud wrote his hypothesis.
I'm also not fluent in C++, so I don't know what possible change he was referring to. It's a generic error, and I have no idea :/. Anyway, thanks for building and testing what I thought. |
This reminds me that in DeX mode, gamepad input will go to the last window that was touched on the device. You need to press the virtual touchpad once for input to go to DeX, as opposed to going on your local device. I don't know if this applies to keyboard and mouse input as well. I have a Fold4 and therefore have access to DeX mode, and often run into this when trying to use a gamepad with it. |
Well, even if it were the case, which I have not confirmed. The fact that the issue only came up with versions past 4.1 is the problem. Something has changed. I can run both 4.1 and 4.3, however, one has a working keyboard and the other does not. So even if this workaround were to work, this is not what this thread would be about. Exaggerated example but: Back on topic, As deducted from OP and my testing, between version 4.1 and 4.1.1, something was changed about the way, keyboard input is handled. This broke the DeX Keyboard input. |
Does that mean this fix is dead in the water? |
I'm still open for any code change suggestions. But as I mentioned before: I'll need a code snippet to insert and the location. I'll test everything, but I can not investigate something in a language that I don't personally use, so please provide any suggestion, I'll test it out. |
Sorry, I have no idea what to do. I read the lines related to input and couldn't find any possible code problems for any solution :/ |
I encountered an issue very similar with the 8bitdo Gbros adapter where if I press the heart button while using bluetooth mode, even on empty projects. No controller is needed to trigger the issue. I needed 32 bit support for intercepting the GBA trade sequence that the GBA uses with the GameCube.... core/input/input.cpp:1039 - Index (int)p_button = -180602665 is out of bounds ((int)JoyButton::MAX = 128). |
Godot version
4.1.1 PlayStore
System information
Samsung Galaxy S20 FE (Mobile Renderer)
Issue description
I installed Godot Engine 4.1.1, and in the Phone it works fine, but when I try to use in Dex mode with my mouse and keyboard, I can't event use WASD and Mouse to move in Editor. Also, there is some input errors on the Output.
Steps to reproduce
Minimal reproduction project
This looks like a generic error, isn't on a specific project.
The text was updated successfully, but these errors were encountered: