scrcpy icon indicating copy to clipboard operation
scrcpy copied to clipboard

Support game controllers

Open laqyx opened this issue 6 years ago • 17 comments

I know its note quite the goal of this project but would it be possible to use an Xbox 360 controller connected to the pc on my android phone trough scrcpy

laqyx avatar Mar 26 '18 20:03 laqyx

Technically, it's possible: GameController.

It would probably add some complexity to make the mappings customizable, though.

rom1v avatar Mar 27 '18 06:03 rom1v

Might as well consider keyboard mapping for games like pubg Controlling android via keyboard by using different keys doing many things On Linux. It eliminates the need of emulator.

ghost avatar Nov 18 '18 15:11 ghost

Any update from this?

AyraHikari avatar Jul 29 '19 22:07 AyraHikari

Would also like to know

Lolihunter1337 avatar Sep 26 '19 19:09 Lolihunter1337

I've been killing myself for hours now looking how to do this. 😔 Pretty much impossible unless you're able to simulate windows touch events using the controller.

It would probably add some complexity to make the mappings customizable, though.

Just need the controller to show up on Panda gamepad app or Octopus app.

m4heshd avatar Feb 12 '20 02:02 m4heshd

+1 to this idea. Would love to be able to use my Xbox controller to play on games that support controllers.

Dom-R avatar Apr 23 '20 05:04 Dom-R

@m4heshd Maybe it's possible to map it to windows key presses? I don't really know though, just a big guess.

ar065 avatar Apr 25 '20 19:04 ar065

hi devs, are you working on this? I was trying to play Minecraft through scrcpy today when I found this issue. Would be great if this makes it to the application!

tm9k1 avatar Nov 30 '20 11:11 tm9k1

I'm up for this, too! I've not been able to find a perfect non-usb bluetooth controller that fits comfortably in my hands, and my phone doesn't support charge + usb otg at the same time, especially the device battery drains out quite fast while gaming.

Playing on scrcpy with controller, and with a bigger screen plus not having to worry about battery would be a blast!

ghost avatar Feb 09 '21 11:02 ghost

From some quick investigation, I've discovered this is possible by using uinput. Normal apps don't have permission to use it, but the adb shell has. That means we can emulate any input device we want, including controllers. I may try writing a pull request when I have time, but it shouldn't be too much work.

PS: If anybody else wants to confirm it, run this from adb shell.

LHLaurini avatar Feb 12 '21 17:02 LHLaurini

It's working. Please test #2130 and let me know about any issues.

LHLaurini avatar Feb 18 '21 21:02 LHLaurini

Hello!

I tried to install and use #2130, but it's not working for me. Should I make any particular configuration?

Please help me!

Diamantaeres avatar Feb 09 '22 19:02 Diamantaeres

@scaldav If #2130 doesn't work for you, it's likely your phone isn't supported (at least not without root). Using the same method as in #2632 would probably make it work on all devices, but I'm currently not working on that anymore. Might give it a shot again someday, but I don't guarantee anything.

LHLaurini avatar Feb 10 '22 05:02 LHLaurini

Hello!

The problem was the SCRCPY_SERVER_PATH variable. I had no idea of how to set it. Now everything works perfectly, thanks a lot!

Thanks you!

Diamantaeres avatar Feb 10 '22 07:02 Diamantaeres

Any updates on this I would like to use my Xbox Wired controller via my PC

27hectormanuel avatar May 14 '22 22:05 27hectormanuel

any updates? pls add...

paliszarok avatar Jun 27 '22 04:06 paliszarok

Yo yo yo I also wanna play diablo immortal with my gamepad! It's the only and only missing feature we need!! plzz

DarkevilPT avatar Apr 10 '23 18:04 DarkevilPT