mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Merge pull request #201 from tchaikov/remove-dependency
remove dependency on <linux/input.h>
This commit is contained in:
2
djvu.c
2
djvu.c
@@ -45,7 +45,7 @@ static int handle(lua_State *L, ddjvu_context_t *ctx, int wait)
|
||||
{
|
||||
const ddjvu_message_t *msg;
|
||||
if (!ctx)
|
||||
return;
|
||||
return -1;
|
||||
if (wait)
|
||||
msg = ddjvu_message_wait(ctx);
|
||||
while ((msg = ddjvu_message_peek(ctx)))
|
||||
|
||||
9
input.c
9
input.c
@@ -20,7 +20,12 @@
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#ifdef EMULATE_READER
|
||||
#include <SDL.h>
|
||||
#define EV_KEY 0x01
|
||||
#else
|
||||
#include <linux/input.h>
|
||||
#endif
|
||||
#include "input.h"
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
@@ -139,6 +144,7 @@ static int openInputDevice(lua_State *L) {
|
||||
}
|
||||
|
||||
static int closeInputDevices(lua_State *L) {
|
||||
#ifndef EMULATE_READER
|
||||
int i;
|
||||
for(i=0; i<NUM_FDS; i++) {
|
||||
if(inputfds[i] != -1) {
|
||||
@@ -152,6 +158,9 @@ static int closeInputDevices(lua_State *L) {
|
||||
waitpid(-1, NULL, 0);
|
||||
}
|
||||
return 0;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
static int waitForInput(lua_State *L) {
|
||||
|
||||
Reference in New Issue
Block a user