libevdev_grab(3) ================ NAME ---- libevdev_grab - grab the kernel device and become its exclusive user. SYNOPSIS -------- #include enum EvdevGrabModes { LIBEVDEV_GRAB, LIBEVDEV_UNGRAB, }; int libevdev_grab(struct libevdev *dev, int grab); DESCRIPTION ----------- *libevdev_grab* performs an *EVIOCGRAB* on the kernel device, making this process the exclusive recipient of events from that device. This disrupts event delivery to other processes including in-kernel consumers of these events such as *rfkill(1)*. It is usually a bad idea to use this function. An attempt to grab or ungrab a device already grabbed or currently not grabbed device will be ignored and returns success. PARAMETERS ---------- *dev*:: Pointer to the libevdev device. *grab*:: To grab the device, use LIBEVDEV_GRAB. To ungrab the device, use LIBEVDEV_UNGRAB. RETURN VALUE ------------ On success, *libevdev_grab* returns zero. On failure, a negative errno is returned. *EINVAL*:: An invalid grab mode was specified. For a full list of potential error codes consult *ioctl(2)*.