From aab9b1d209c088c6c976aa0289adaae8dec19bbf Mon Sep 17 00:00:00 2001 From: Philip Howard Date: Wed, 4 Jan 2017 15:21:08 +0000 Subject: [PATCH] Fix to allow daemon detection in ES This fix is in response to this forum post: http://forums.pimoroni.com/t/picade-hat-joystick-not-detected-w-out-usb-keyboard-plugged-in/3704 User discovered that Picadehatd input isn't detected by EmulationStation unless a keyboard is plugged in. I've updated the `UInput` initialization to ensure it sets up a virtual device. It seems to create `/dev/input/event0` on my system with this change, Previously keyboard events were raised to the system, but EmulationStation didn't detect or attempt to handle any keyboard input. --- daemon/usr/bin/picadehatd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/usr/bin/picadehatd b/daemon/usr/bin/picadehatd index 37c78c4..221193e 100755 --- a/daemon/usr/bin/picadehatd +++ b/daemon/usr/bin/picadehatd @@ -103,7 +103,7 @@ gpio.setup(BUTTONS, gpio.IN, pull_up_down=gpio.PUD_UP) gpio.setup(BUTTON_POWER, gpio.IN, pull_up_down=gpio.PUD_UP) try: - ui = UInput() + ui = UInput({e.EV_KEY: KEYS.values()}, name="Picade-HAT", bustype=e.BUS_USB) except uinput.UInputError as e: sys.stdout.write(e.message)