LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-19-2019, 12:10 PM   #1
babag
Member
 
Registered: Aug 2003
Posts: 419

Rep: Reputation: 31
evdev, xte and xf86 buttons


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 roomtone
where 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,
babag
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED]How do I install xf86-input-evdev to fix my touchpad control panel TheJooomes Linux - Laptop and Netbook 1 05-24-2019 11:08 AM
[SOLVED] found patches to build xf86-server-s3virge and xf86-server-tseng nobodino Slackware 1 07-14-2018 07:09 AM
xf86-input-keyboard and xf86-input-mouse masked CollieJim Gentoo 4 11-09-2009 09:57 PM
Mouse back and forward buttons are interpreted as buttons 2 and 3 (MX610) jot-87 Linux - Hardware 1 08-06-2007 11:12 AM
Help binding mouse buttons to keyboard buttons Eckstona Linux - Hardware 6 09-24-2006 07:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration