Skip to content

Commit 61128c5

Browse files
author
okay
committed
reMarkable: don't exclusive grab input for remarkable build
1 parent 50a965c commit 61128c5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

input/input.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ static int openInputDevice(lua_State *L) {
7171
int childpid;
7272
int fd = findFreeFdSlot();
7373
if (fd == -1) return luaL_error(L, "no free slot for new input device <%s>", inputdevice);
74+
char *ko_dont_grab_input = getenv("KO_DONT_GRAB_INPUT");
75+
7476

7577
#ifdef POCKETBOOK
7678
int inkview_events = luaL_checkint(L, 2);
@@ -104,7 +106,10 @@ static int openInputDevice(lua_State *L) {
104106
} else {
105107
inputfds[fd] = open(inputdevice, O_RDONLY | O_NONBLOCK, 0);
106108
if (inputfds[fd] != -1) {
107-
ioctl(inputfds[fd], EVIOCGRAB, 1);
109+
if (ko_dont_grab_input == NULL) {
110+
ioctl(inputfds[fd], EVIOCGRAB, 1);
111+
}
112+
108113
/* prevent background command started from exec call from grabbing
109114
* input fd. for example: wpa_supplicant. */
110115
fcntl(inputfds[fd], F_SETFD, FD_CLOEXEC);

0 commit comments

Comments
 (0)