Article 4WT8Y evdev, xte and xf86 buttons

evdev, xte and xf86 buttons

by
babag
from LinuxQuestions.org on (#4WT8Y)
i'm using a second keyboard to assign macros and am running into some questions. generally, it works great. there are, however, a couple of instances where keys are reported as things like xf86back.

here's how my script starts, using evdev:
Code:import os
from evdev import InputDevice, categorize, ecodes
#dev = InputDevice('/dev/input/event6') # Do not use event numbers for identifying keyboard as they change with reboots.
dev = InputDevice('/dev/input/by-id/usb-CHESEN_USB_Keyboard-event-kbd') # Use IDs for identifying keyboard as they do not change with reboots.
dev.grab()

for event in dev.read_loop():
if event.type == ecodes.EV_KEY:
key = categorize(event)
if key.keystate == key.key_down:
if key.keycode == 'KEY_ESC':
os.system("xte 'keydown Control_L' 'keydown KP_0' 'keyup KP_0' 'keyup Control_L'") # Fill TS with 50ms roomtonewhere the key is defined as 'KEY_ESC', how would i use something like an xf86 key call? if i just replace ESC with xf86back, for example, it doesn't work. tried all the variants for capitalization with no help.

thanks,
babaglatest?d=yIl2AUoC8zA latest?i=zlyrhusMcBk:bEf3ECq_IfA:F7zBnMy latest?i=zlyrhusMcBk:bEf3ECq_IfA:V_sGLiP latest?d=qj6IDK7rITs latest?i=zlyrhusMcBk:bEf3ECq_IfA:gIN9vFwzlyrhusMcBk
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments