diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index ce8c49fb3..0b1e7cc79 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -890,6 +890,17 @@ void CControlAPI::RebootCGI(CyhookHandler *hh) } //----------------------------------------------------------------------------- + +void dev_uinput_sync(int fd) { + struct input_event ev; + + gettimeofday(&ev.time, NULL); + ev.type = EV_SYN; + ev.code = SYN_REPORT; + ev.value = 0; + write(fd, &ev, sizeof(ev)); +} + int CControlAPI::rc_send(int ev, unsigned int code, unsigned int value) { struct input_event iev; @@ -943,12 +954,14 @@ void CControlAPI::RCEmCGI(CyhookHandler *hh) close(evd); return; } + dev_uinput_sync(evd); if (rc_send(evd, sendcode, KEY_RELEASED) < 0) { perror("writing 'KEY_RELEASED' event failed"); hh->SendError(); close(evd); return; } + dev_uinput_sync(evd); close(evd); #else /* 0 == KEY_PRESSED in rcinput.cpp */