Python Forum
Using evdev for background script
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using evdev for background script
#2
I figured it out. Looks like I can't delete a post, so I may as well provide the answer. To get exclusive access to a device, the following code worked well:

from evdev import ecodes, InputDevice
dev = InputDevice('/dev/input/by-id/[deviceID]')
dev.grab()
...and to release exclusive access...
dev.ungrab()
Simple enough!
Reply


Messages In This Thread
Using evdev for background script - by hotcocoa - Jun-18-2022, 09:46 PM
RE: Using evdev for background script - by hotcocoa - Jun-19-2022, 10:41 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  win32 API: Launch Application to RDP session from background process python script rangeshgupta 0 2,190 May-28-2020, 09:41 PM
Last Post: rangeshgupta
  Using Subprocess.Popen to start another python script running in background on Window johnb546 0 13,712 Jun-01-2018, 01:57 PM
Last Post: johnb546
  Differntiating two keyboards using evdev HANSJORG2 5 7,560 Mar-08-2018, 02:09 PM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020