-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
Unable to use keyboard on Unreal Engine game #87
Comments
I just installed the game on some device, it works for me. I can type text for example in the "team chat". |
Yes but the controls don't work. I've seen people using OTG keyboard and mice on YouTube to play. |
Any progress on this? Is there a way for ScrCpy to say an external OTG keyboard is connected? Some Apps don't recognize the keyboard because it's looking for an OTG or bluetooth keyboard. |
One possibility would be using HID over AOA to generate HID events. I already implemented HID events forwarding (i.e. forward raw events from an USB keyboard or mouse) in the past (here is a sample project), but generating the HID events from SDL events requires some work (including reading the USB HID spec). And like audio support in scrcpy, this would only work on Linux (which is still great). This could also be interesting as a separate project: this would make the computer keyboard act like an OTG keyboard. |
I have a work around for this, not fully sure of the implications but it at least works for me in PUBG. It now works in PUBG, I can also still type normally and paste text.. things that were handled in text input will not work like volume up etc, they could easily be moved to the key handling event, but I haven't bothered. I have not thoroughly tested this.. really just wanted it to work for games and now it does.. no longer have to connect a bluetooth keyboard. |
Cool 👍
You should click on "fork", then push your branch to your github fork and post the link here :)
What is your keyboard layout? What if you press Shift+ I initially implemented key events using keycodes only (before scrcpy was published), but after reading documentation and discussions on irc #sdl, I think there is no way to work independently of your keyboard layout. Maybe I am wrong though.
On |
I don't see a mapping for "<" in the android keycodes.h, which is what my Shift + "," would be. But I think as long as a mapping is created you could use any layout. Also, thanks to you for creating this! The app is amazing and I can't say that enough. I am an original kickstarter backer for the 'superbook' and this might replace my need for it... all though I am still looking forward to it. |
I agree, but it may not work with all layout without remapping (while with text input events it should work). You said:
This is a possibility. 👍 |
or:
Please try the
I decided to use a command-line option, because there is no clear feedback about the current mode, which may be confusing if someone enables it without noticing. EDIT: not sure I will keep it that way. Maybe I will remove the option and bind it to a shortcut. What do you think? |
I changed my mind, I remove the command-line argument, and bound |
@aneutron @pete1414 Could you test the branch |
I downloaded the rawkeyevents branch and compiled it in 32 bit and it works with Octopus + PUBG with no issues. I am not near a 64 bit machine at the moment but would not anticipate any issues. Thank you! |
I should also add my feed back re Ctrl K. For me it does not make a difference because raw key mode seems to work for me for everything so I would just leave it in that mode. But for someone who needs to go back and forth I imagine they would prefer the shortcut. |
Thank you for your feedbacks 👍
Even for If it makes no difference for such layouts, I could add a |
The rawkeyevents mode is basically what I need. Only problem I have with it, is that I'm using a german keyboard and every key that does not have a mapping in convert_text_keycode is not handled at all. My personal solution up until now was to make an exception for wasd and handle it like the new rawkeyevents mode. You can see what I did here: Would a hybrid mode that handles non-mapped keys as textinputs be possible? |
@King-Slide Thank you for your feedbacks.
That's expected, that's why this option is disabled by default.
In King-Slide@465b915, if
I think it is not possible to have 1 mode to cover all cases. That's why I think exposing 2 modes, that can be toggled, would be a good compromise. What do you think? |
Sorry for the return values. They were some remnants of a failed experiment. Switching modes constantly is just frustrating, cause I forget that from time to time. I created a branch from the current raw_key_events branch, introduced a toggleable hybrid_key_events mode, which is just a raw_key_events mode for a-z 0-9 and the space key: |
@King-Slide Interesting. I didn't tested, but the hybrid could also include |
@rom1v Here are the changes: King-Slide@d09babc
Enabling raw_key_events or hybrid_key_events disables the other. It seems to work with my german keyboard layout as far as I can tell. |
@King-Slide Great. I didn't test (yet), but if this work both for typing text and for games, I think this could be the default and only mode (to avoid adding unnecessary options and keep it as simple as possible). Note: you could use |
@King-Slide num chars (0 to 9) are not "portable" (e.g. the shift state depends on the layout). As a compromise, I suggest to send letters and space as key events (unless ALT or META is pressed), and keep the remaining as text input event. (commit This would be the only mode (=> simplicity) if it does not cause problems. What do you think? |
Any feedbacks? |
As far as I understand SDL a keypress triggers a textinput and a keyevent afterwards. By using isalnum on the textinput, I can differentiate between a plain number input and a shift + number To prevent double outputs I break out of input_manager_process_key when I detect shift + a number. This way I don't have any double inputs, my number keys are handled raw and my current localization works because it is handled by input_manager_process_text_input. You can see what I did here: |
@rom1v Ah, Mouse feature is not implemented yet, I hope it will be soon.. Thanks. I love Scrcpy. :-) |
Yes, mouse forwarding is implemented (you can click on the screen), but not in capture mode for gaming. |
Was looking for a solution to this and ended up here. Is there a scope for this "capture mode" to be added in future builds? Would really open gates for some good gaming experience. Coincidentally I was looking for ways to play PUBG mobile too, just like the others above. Whether or not you will, you are doing great work. Cheers! |
I did not investigate how to implement it yet (#269). If someone have time and is interested, please go ahead 😉 Otherwise I might look at it some day. |
Hey, both my Windows defender and Anti-virus warned me of running this file. It didn't happen with the original build. |
What do they say? I downloaded it, its SHA-256 is the expected one, and if I scan it online with virustotal, everything is fine:
Maybe the reason is that they detected that the original file has been replaced (same filepath, different content)? By the way, you don't need this temporary file anymore, the feature is included in v1.4. |
Okay. Thank you. Yeah must be a false positive. The antivirus uploaded the file to its servers(apparently cause it's an exe that's rare) and later reported that it's safe. Sorry for the confusion. |
Hi everyone please help me to find where pubg controller are implemented in the code |
@Mehardeep See 411aa4f and |
This improves text input, but it breaks the expected behavior in games again: <#87>. To get the previous behavior back, pass an explicit option: scrcpy --prefer-text-events=non-alpha
Hey !
First of all thanks for the amazing work. I noticed the keyboard is usable in a normal manner, and it works for apps such as Messenger, etc., and it works with Hearthstone too. However, it does not work with PUBG Mobile.
I just noticed this, and thought that maybe it's worth reporting, because on the one hand it could be something with Unreal Engine, but it could also be a bug in scrcpy.
Anyway, you're doing amazing work, thanks a lot !
The text was updated successfully, but these errors were encountered: