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
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 !
Reacted by Licaon_Kter, Mahesh Bandara Wijerathna, NishuTyagi2 and oven
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.
Is there a way for ScrCpy to say an external OTG keyboard is connected?
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).
Please see screenshot below. Top half is key events from Scrcpy, bottom half is keyboard events from bluetooth keyboard. In both situations I held down the 'w' key'. It seems Scrcpy sends Key up before it is released.
I have a work around for this, not fully sure of the implications but it at least works for me in PUBG.
I am not too familiar with github, so I'll just explain what I did.
in scrcpy.c
I removed SDL_TEXTINPUT from the case statement.
I copied the call in KEYUP to KEYDOWN.
Then in Convert.c I added more key mappings to include alpha keys and number keys and a few others..
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.
I am not too familiar with github, so I'll just explain what I did.
You should click on "fork", then push your branch to your github fork and post the link here :)
Then in Convert.c I added more key mappings to include alpha keys and number keys and a few others..
What is your keyboard layout? What if you press Shift+, (for example, on a French keyboard)?
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.
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.
On dev branch, volume shortcuts have been changed to Ctrl+up and Ctrl+down without text input.
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.
Please try the rawkeyevents branch. If it works as expected, I will merge it into dev.
press Ctrl G to enter 'game' mode
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?
Any way to make mouse work? Without mouse working the games can be played properly. I tried using Octopus app for mapping and was able to walk/run but couldn't get mouse working. (I'm using Linux)
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!
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
as A-W-S_D buttons are working in PUBG (scrcpy) but when i sent through cmd (adb input keyevent ) its not working
Activity
rom1v commentedon Mar 22, 2018
I just installed the game on some device, it works for me. I can type text for example in the "team chat".
aneutron commentedon Mar 22, 2018
Yes but the controls don't work. I've seen people using OTG keyboard and mice on YouTube to play.
pete1414 commentedon Apr 4, 2018
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.
rom1v commentedon Apr 4, 2018
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.
pete1414 commentedon Apr 25, 2018
Please see screenshot below. Top half is key events from Scrcpy, bottom half is keyboard events from bluetooth keyboard. In both situations I held down the 'w' key'. It seems Scrcpy sends Key up before it is released.
pete1414 commentedon Apr 27, 2018
I have a work around for this, not fully sure of the implications but it at least works for me in PUBG.
I am not too familiar with github, so I'll just explain what I did.
in scrcpy.c
I removed SDL_TEXTINPUT from the case statement.
I copied the call in KEYUP to KEYDOWN.
Then in Convert.c I added more key mappings to include alpha keys and number keys and a few others..
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.
This applies to #122 and #127 as well I believe.
rom1v commentedon Apr 27, 2018
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+
,(for example, on a French keyboard)?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
devbranch, volume shortcuts have been changed to Ctrl+up and Ctrl+down without text input.pete1414 commentedon Apr 27, 2018
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.
rom1v commentedon Apr 28, 2018
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. 👍
Add "raw key events" mode
Add "raw key events" mode
rom1v commentedon Aug 15, 2018
I added a command-line option:(see next comment)or:
Please try the
rawkeyeventsbranch. If it works as expected, I will merge it intodev.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?
rom1v commentedon Aug 15, 2018
I changed my mind, I remove the command-line argument, and bound
Ctrl+kinstead (the mode may need to be toggled while scrcpy is running).rom1v commentedon Aug 18, 2018
@aneutron @pete1414 Could you test the branch
rawkeyeventsand tell me if it fixes/workarounds the problem, please?22 remaining items
shashi007 commentedon Oct 6, 2018
Any way to make mouse work? Without mouse working the games can be played properly. I tried using Octopus app for mapping and was able to walk/run but couldn't get mouse working. (I'm using Linux)
rom1v commentedon Oct 6, 2018
@shashi007 See #269.
shashi007 commentedon Oct 6, 2018
@rom1v Ah, Mouse feature is not implemented yet, I hope it will be soon.. Thanks. I love Scrcpy. :-)
rom1v commentedon Oct 6, 2018
Yes, mouse forwarding is implemented (you can click on the screen), but not in capture mode for gaming.
IAmMadMax commentedon Oct 9, 2018
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!
rom1v commentedon Oct 9, 2018
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.
walkiitm commentedon Oct 13, 2018
Hey, both my Windows defender and Anti-virus warned me of running this file. It didn't happen with the original build.
rom1v commentedon Oct 13, 2018
What do they say?
Could you check its SHA-256 to verify that your file is exactly the same?
I downloaded it, its SHA-256 is the expected one, and if I scan it online with virustotal, everything is fine:
https://www.virustotal.com/fr/file/7a027131e5669dfb01e34cc75f080728ef5434cd3f21f0b3e8cc89ac30fe5887/analysis/1539415214/
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.
walkiitm commentedon Oct 13, 2018
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.
Mehardeep commentedon Dec 12, 2018
Hi everyone please help me to find where pubg controller are implemented in the code
as A-W-S_D buttons are working in PUBG (scrcpy) but when i sent through cmd (adb input keyevent ) its not working
rom1v commentedon Dec 12, 2018
@Mehardeep See 411aa4f and
injectKeyEvent()on the server.Always prefer text events by default
Always prefer text events by default
Add "raw key events" mode