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
I'm writing a bot to automate some movement with a python script in a running rom. I'm using RetroPie/Emulationstation to run lr-gambatte and those projects do not rely on X11. Most libraries to emulate a virtual keyboard input don't work.
The following python3 script (using uinput, https://github.com/tuomasjjrasanen/python-uinput) works in the emulationstation menu, but doesn't in game (lr-gambatte). I start the script via SSH as root.
Does anyone have an idea, how to send/emulate keystrokes via a python script that is started via SSH? I'm not opposed to switching the script language.
import time
import uinput
def main():
events = (uinput.KEY_LEFT, uinput.KEY_DOWN, uinput.KEY_D)
with uinput.Device(events) as device:
time.sleep(1)
device.emit_click(uinput.KEY_LEFT)
time.sleep(0.2)
device.emit_click(uinput.KEY_D)
time.sleep(0.2)
device.emit_click(uinput.KEY_DOWN)
time.sleep(0.2)
if __name__ == "__main__":
main()
The text was updated successfully, but these errors were encountered:
Thank you for bringing this to my attention. That might be a crude hack, but I'll keep it in mind as a last resort approach. I hope to find a scriptable library designed to send keyboard input, which is accepted by retroarch.
I'm writing a bot to automate some movement with a python script in a running rom. I'm using RetroPie/Emulationstation to run lr-gambatte and those projects do not rely on X11. Most libraries to emulate a virtual keyboard input don't work.
The following python3 script (using uinput, https://github.com/tuomasjjrasanen/python-uinput) works in the emulationstation menu, but doesn't in game (
lr-gambatte
). I start the script via SSH as root.Does anyone have an idea, how to send/emulate keystrokes via a python script that is started via SSH? I'm not opposed to switching the script language.
The text was updated successfully, but these errors were encountered: