|
|
@ -28,6 +28,7 @@ import evdev
|
|
|
|
|
|
|
|
|
|
|
|
from keymapper.logger import logger
|
|
|
|
from keymapper.logger import logger
|
|
|
|
from keymapper.state import KEYCODE_OFFSET
|
|
|
|
from keymapper.state import KEYCODE_OFFSET
|
|
|
|
|
|
|
|
from keymapper.dev.ev_abs_mapper import JOYSTICK
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def should_map_event_as_btn(type, code):
|
|
|
|
def should_map_event_as_btn(type, code):
|
|
|
@ -47,8 +48,7 @@ def should_map_event_as_btn(type, code):
|
|
|
|
if type == evdev.events.EV_KEY:
|
|
|
|
if type == evdev.events.EV_KEY:
|
|
|
|
return True
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
|
|
if type == evdev.events.EV_ABS and code > 5:
|
|
|
|
if type == evdev.events.EV_ABS and code not in JOYSTICK:
|
|
|
|
# 1 - 5 seem to be joystick events
|
|
|
|
|
|
|
|
return True
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
|
|
return False
|
|
|
|
return False
|
|
|
@ -110,6 +110,5 @@ def handle_keycode(code_code_mapping, macros, event, uinput):
|
|
|
|
target_keycode = input_keycode
|
|
|
|
target_keycode = input_keycode
|
|
|
|
target_type = input_type
|
|
|
|
target_type = input_type
|
|
|
|
|
|
|
|
|
|
|
|
print('write', target_type, target_keycode, event.value)
|
|
|
|
|
|
|
|
uinput.write(target_type, target_keycode, event.value)
|
|
|
|
uinput.write(target_type, target_keycode, event.value)
|
|
|
|
uinput.syn()
|
|
|
|
uinput.syn()
|
|
|
|