alarm-tegra-x1 / a.py

raw file 549 bytes
import evdev

# Locate your actual physical plugged-in keyboard event number from /dev/input/by-id/
device = evdev.InputDevice('/dev/input/event3') 
hidg0 = open('/dev/hidg0', 'wb')

print(f"Forwarding inputs from {device.name} to USB Gadget...")

# Loop to capture events and write standard 8-byte HID reports
for event in device.read_loop():
    if event.type == evdev.ecodes.EV_KEY:
        # (Logic to convert evdev codes to raw USB HID keyboard scan codes goes here)
        # hidg0.write(hid_report_bytes)
        # hidg0.flush()
        pass