Lazarus

Programming => Operating Systems => Linux => Topic started by: guest59697 on June 01, 2018, 10:14:30 am

Title: hook and stop /dev/input/event
Post by: guest59697 on June 01, 2018, 10:14:30 am
hello Thaddy,
hello FPC enthusiasts,

please a low level question:

I have a touchscreen linux embedded,
I don't have the source of the drivers,
I know that the driver maps over /dev/input/event4 -> and the events are forwarded/emulated to  -> /dev/mouse1
I need to be able to stop/inhibit the event4 event bubbling, so stopping the touchscreen, and reenable it without change the config of X, and without exit from the X session.
Do you know if a HOOK api or similar can be used to STOP/RESTART /dev/input/event4 globally, for the whole system/users?
Thank you.
Roberto.
Title: Re: hook and stop /dev/input/event
Post by: Thaddy on June 01, 2018, 10:36:04 am
Hi Roberto, only with sudo rights. It also depends on the system. Btw How are you doing? Haven't spoken to you in a long time.
Technically you should be able to start and stop the device w/o affecting the X session(s)
Title: Re: hook and stop /dev/input/event
Post by: guest59697 on June 01, 2018, 11:43:41 am
hello,

well, I'm very busy, although this summer I'll try to give to this fpc community a little layer for a intel mem manager (parallel).

Look, using chmod, setting no permission at all to /dev/input/event doesn't stop it (probably if it is already open by another task, does nothing, affecting only the next open's)

Any idea? Maybe using mmap function?
Title: Re: hook and stop /dev/input/event
Post by: sash on June 08, 2018, 10:16:25 pm
Hello, I think you can disable device in udev rules
Also I suppose you don't have to. Grab (open exclusively) device file with
Code: C  [Select][+][-]
  1. ioctl(fd, EVIOCGRAB, ...);
so events would be visible to your app only.
TinyPortal © 2005-2018