evdevremapkeys icon indicating copy to clipboard operation
evdevremapkeys copied to clipboard

Map null events

Open mcmirande opened this issue 4 years ago • 10 comments

Hello! I'm trying to remap the buttons of a Logitech G27 wheel and now I discovered your program I feel I'm close to it, so thanks!

However, I have an issue with null unnamed events that I should assign to other joystick buttons

Event code 288 (BTN_TRIGGER) Event code 289 (BTN_THUMB) Event code 290 (BTN_THUMB2) Event code 291 (BTN_TOP) Event code 292 (BTN_TOP2) Event code 293 (BTN_PINKIE) Event code 294 (BTN_BASE) Event code 295 (BTN_BASE2) Event code 296 (BTN_BASE3) Event code 297 (BTN_BASE4) Event code 298 (BTN_BASE5) Event code 299 (BTN_BASE6) Event code 300 (?) Event code 301 (?) Event code 302 (?) Event code 303 (BTN_DEAD) Event code 704 (BTN_TRIGGER_HAPPY1) Event code 705 (BTN_TRIGGER_HAPPY2) Event code 706 (BTN_TRIGGER_HAPPY3) Event code 707 (BTN_TRIGGER_HAPPY4) Event code 708 (BTN_TRIGGER_HAPPY5) Event code 709 (BTN_TRIGGER_HAPPY6) Event code 710 (BTN_TRIGGER_HAPPY7)

For example, there, I need the events 300, 301, and 302 to be assigned to buttons 1, 2, and 3 of my wheel, but I cannot name them because they are null (?), Is there some way to refer to Event Codes other than by their names between parentheses?

This is my config.yaml that works well for other buttons (having names)

`devices:

  • input_name: "G27 Racing Wheel" input_phys: "usb-0000:00:14.0-2/input0" output_name: "G27 Racing Wheel mod" remappings: BTN_DEAD:
    • BTN_TRIGGER `

Thanks a lot in advance

Cheers, Marcos.

mcmirande avatar Nov 06 '20 19:11 mcmirande

Have you tried just using the number? These constants are just enums that map to the codes.

philipl avatar Nov 06 '20 19:11 philipl

Hi philipl, thanks for your quick answer. I tried it but got this output when trying to execute the program

Traceback (most recent call last): File "/home/marcos/.local/bin/evdevremapkeys", line 33, in <module> sys.exit(load_entry_point('evdevremapkeys', 'console_scripts', 'evdevremapkeys')()) File "/home/marcos/evdevremapkeys/evdevremapkeys/evdevremapkeys.py", line 428, in main run_loop(args) File "/home/marcos/evdevremapkeys/evdevremapkeys/evdevremapkeys.py", line 350, in run_loop config = load_config(args.config_file) File "/home/marcos/evdevremapkeys/evdevremapkeys/evdevremapkeys.py", line 186, in load_config return parse_config(config) File "/home/marcos/evdevremapkeys/evdevremapkeys/evdevremapkeys.py", line 191, in parse_config device['remappings'] = normalize_config(device['remappings']) File "/home/marcos/evdevremapkeys/evdevremapkeys/evdevremapkeys.py", line 229, in normalize_config normalize_value(mapping) File "/home/marcos/evdevremapkeys/evdevremapkeys/evdevremapkeys.py", line 236, in normalize_value value = mapping.get('value') AttributeError: 'int' object has no attribute 'get'

The same happens if I use the number of button starting from 1, as are recognized in some programs as "control", within Wine.

Cheers, Marcos.

EDIT: This is the Config file for the output above

`devices:

  • input_name: "G27 Racing Wheel" input_phys: "usb-0000:00:14.0-2/input0" output_name: "G27 Racing Wheel mod" remappings: 300:
    • 288 `

mcmirande avatar Nov 06 '20 20:11 mcmirande

Looks like we need a bit more logic to handle raw numbers. I'd happily accept a patch for it.

philipl avatar Nov 06 '20 23:11 philipl

At that point I just can say "If you can fix it, great, thanks!" hehe. I'll be waiting for any update :)

mcmirande avatar Nov 06 '20 23:11 mcmirande

Hi Philip again. Just a probably unrelated question, is it possible to remap the buttons in xorg.conf (only applicable to X sessions, of course)? If so, do you know how? I tried with the help I found on the web, but it doesn't work and I don't know if it is even possible or I'm doing something wrong...

Thanks, Marcos.

El vie., 6 de noviembre de 2020 8:37 p. m., Philip Langdale < [email protected]> escribió:

Looks like we need a bit more logic to handle raw numbers. I'd happily accept a patch for it.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/philipl/evdevremapkeys/issues/33#issuecomment-723347259, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADTTAERBF7KHHGTPKY2ZOLDSOSCDXANCNFSM4TNBKOIQ .

mcmirande avatar Nov 07 '20 15:11 mcmirande

For X sessions, just use xbindkeys.

philipl avatar Nov 07 '20 15:11 philipl

Thanks! I'll look for that

El sáb., 7 nov. 2020 a las 12:48, Philip Langdale ([email protected]) escribió:

For X sessions, just use xbindkeys.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/philipl/evdevremapkeys/issues/33#issuecomment-723461495, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADTTAEUB5EQLK4RBC3MXQFLSOVT5RANCNFSM4TNBKOIQ .

-- Juan Marcos Mirande Fundación Miguel Lillo (JTP) - CONICET (Inv. Independiente) Miguel Lillo 251 (4000) San Miguel de Tucumán Argentina

mcmirande avatar Nov 07 '20 15:11 mcmirande

Hello Philip, I was reading about several options to do what I need, without success. The closest I was, was with your program, but still have the problem with the null events. With xbindkeys, as with xinput, the buttons of my G27 aren't recognized as events...

Cheers, thanks, and I'm sorry for the insistence

Marcos.

mcmirande avatar Nov 09 '20 17:11 mcmirande

I'll see if I can get around to this

DanielJoyce avatar Dec 08 '20 21:12 DanielJoyce

Hi, awesome, thanks!

El mar., 8 de diciembre de 2020 6:22 p. m., Daniel [email protected] escribió:

I'll see if I can get around to this

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/philipl/evdevremapkeys/issues/33#issuecomment-741052575, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADTTAESEMFWGDP6ERXIWMITST2KIDANCNFSM4TNBKOIQ .

mcmirande avatar Dec 08 '20 21:12 mcmirande

Going to try and attempt this if I get some time. Thanks.

parkerlreed avatar Jan 30 '24 17:01 parkerlreed

I decided to actually go and do it, so fixed in https://github.com/philipl/evdevremapkeys/commit/e5f251720c470f047549b59acff16ef701e28120

philipl avatar Jan 31 '24 05:01 philipl

Thank you!

parkerlreed avatar Jan 31 '24 18:01 parkerlreed