threebrooks / UniversalController

Bluetooth-connected keyboard via Android app
20 stars 0 forks source link

OMG .. can some of this code be repurposed for virtual keyboard? #3

Closed cgmckeever closed 4 years ago

cgmckeever commented 4 years ago

HI! -- Im trying to create virtual keystrokes via a script. Im at a loss -- is there any code that you've pieced together that I may be able to leverage? Im trying not to have a physical or your app-bluetooth keyboard. Just some scripts that mock keypresses. Any thoughts would be extremely awesome!

cgmckeever commented 4 years ago

I see you are using uinput -- which is what Ive been wrestling with, but not able to have it register in an emulator

threebrooks commented 4 years ago

Hi cgmckeever,

that part is super easy actually. I am using the "uinput" Python module:

https://pypi.org/project/python-uinput/

to generate the keypresses on the Pi side.

threebrooks commented 4 years ago

Make sure the uinput kernel module is loaded also. For initial debugging purposes I also suggest trying to first inject keyboard events into the normal Linux CLI. When that works you can move on to the Emulator.

cgmckeever commented 4 years ago

Thanks .. I can get it to appear in the F4 console while sending it from a SSH session. Just nothing seems to catch in an emulator.

Also, keystrokes are caught in emulation station itself

cgmckeever commented 4 years ago

@threebrooks THANKS .. finally got it. Appears emit_combo as well as some other oddities of timing/etc was not making things happy. But all set now, can exit out of a game from a non-player button combo!!