mirror of
https://github.com/dekuNukem/USB4VC.git
synced 2025-10-24 11:20:50 -07:00
evdev test
This commit is contained in:
BIN
captures/duckypad numpad switch to cs delay evdev poc.sal
Normal file
BIN
captures/duckypad numpad switch to cs delay evdev poc.sal
Normal file
Binary file not shown.
@@ -1,3 +1,9 @@
|
||||
# print(this_device.name)
|
||||
# print(this_cap)
|
||||
# print(check_is_gamepad(this_cap))
|
||||
# print("!!!!!!!!!!!!!!!!!!!!!!")
|
||||
|
||||
|
||||
ABS_Z = 0x02
|
||||
ABS_RX = 0x03
|
||||
ABS_RY = 0x04
|
||||
|
||||
@@ -32,7 +32,6 @@ SPI_MISO_MSG_TYPE_KB_LED_REQUEST = 129
|
||||
SPI_MOSI_MAGIC = 0xde
|
||||
SPI_MISO_MAGIC = 0xcd
|
||||
|
||||
|
||||
PCARD_BUSY_PIN = 20
|
||||
SLAVE_REQ_PIN = 16
|
||||
|
||||
@@ -109,5 +108,25 @@ PID_GENERIC_GAMEPORT_GAMEPAD = 7
|
||||
PID_BBC_MICRO_JOYSTICK = 14
|
||||
PID_RAW_USB_GAMEPAD = 127
|
||||
|
||||
devices = [evdev.InputDevice(path) for path in evdev.list_devices()]
|
||||
|
||||
print("hello world!")
|
||||
for device in devices:
|
||||
print(device.path, device.name, device.phys)
|
||||
|
||||
# import asyncio, evdev
|
||||
|
||||
# mouse = evdev.InputDevice('/dev/input/event0')
|
||||
# keybd = evdev.InputDevice('/dev/input/event6')
|
||||
|
||||
|
||||
# async def print_events(device):
|
||||
# async for event in device.async_read_loop():
|
||||
# empty = list(keyboard_event_spi_msg_template)
|
||||
# xfer_when_not_busy(empty)
|
||||
# print(device.path, evdev.categorize(event), sep=': ')
|
||||
|
||||
# for device in mouse, keybd:
|
||||
# asyncio.ensure_future(print_events(device))
|
||||
|
||||
# loop = asyncio.get_event_loop()
|
||||
# loop.run_forever()
|
||||
@@ -911,10 +911,6 @@ def get_input_devices():
|
||||
dev_dict['is_mouse'] = True
|
||||
if 'KEY_ENTER' in cap_str and "KEY_Y" in cap_str:
|
||||
dev_dict['is_kb'] = True
|
||||
# print(this_device.name)
|
||||
# print(this_cap)
|
||||
# print(check_is_gamepad(this_cap))
|
||||
# print("!!!!!!!!!!!!!!!!!!!!!!")
|
||||
if check_is_gamepad(this_cap):
|
||||
dev_dict['is_gp'] = True
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user