Luiz Henrique Laurini
Luiz Henrique Laurini
> Injecting [`KeyEvent`](https://developer.android.com/reference/android/view/KeyEvent) (already used for keyboard) should also allow to inject gamepad buttons For some reason, that didn't even cross my mind. I'll look into it.
Ok, so after a little research, here what I've found so far: - Using `IInputManager.injectInputEvent` to inject `KeyEvent`s and `MotionEvent`s wouldn't work with multiple controllers, unless we can somehow register...
> [`InputDevice.SOURCE_GAMEPAD`](https://developer.android.com/reference/android/view/InputDevice#SOURCE_GAMEPAD) Yes, we'd need to use `InputDevice.SOURCE_GAMEPAD`, `InputDevice.SOURCE_JOYSTICK` and `InputDevice.SOURCE_DPAD`, depending on the kind of event. > and pass some arbitrary `deviceId`? That was my first idea, but it...
> But in this case it is only working through code or already has an executable to download? because if it is a code you could tell me where to...
I implemented event injection, as suggested, but I can't seem to find a way to set axes from `MotionEvent.obtain` and there's no `setAxis` method either, so I just tested button...
Tested both methods with "Dead Trigger" (an Unity game). With uinput, controls work out of the box. By injecting events, every single button needs to be rebound (I'm surprised it...
> Hmm, opening /dev/uinput requires root permissions, right? Nope. Just limited to the ADB shell (at least on my phone). Here, look: ``` f41:/dev $ ls -l /dev/uinput crw-rw---- 1...
> Does it mean it can also be used to inject key/touch events and avoid (in some way) the ASCII-limitation of Android text injection? Yes, it can. When I started...
I decided to make some changes so that a future pull request can add support for keyboard (or even mouse) using uinput.
> You might be interested in [`android.system.Os`](https://developer.android.com/reference/android/system/Os). The documentation does not show all the methods, because some are hidden, but you can probably still access them. For example [ioctlInt()](https://android.googlesource.com/platform/libcore/+/dc5351ff0193f6c82478981e32561a779651821a/luni/src/main/java/android/system/Os.java#320). Thanks....