diff options
-rw-r--r-- | minuitwrp/events.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/minuitwrp/events.cpp b/minuitwrp/events.cpp index 54119ebc0..04545b64f 100644 --- a/minuitwrp/events.cpp +++ b/minuitwrp/events.cpp @@ -162,7 +162,7 @@ static int vk_init(struct ev *e) len = ioctl(e->fd->fd, EVIOCGNAME(sizeof(e->deviceName)), e->deviceName); if (len <= 0) { - printf("Unable to query event object.\n"); + LOGE("Unable to query event object.\n"); return -1; } #ifdef _EVENT_LOGGING @@ -179,7 +179,7 @@ static int vk_init(struct ev *e) // Blacklist these "input" devices, use TW_INPUT_BLACKLIST := "accelerometer\x0atest1\x0atest2" using the \x0a as a separator between input devices if (strcmp(e->deviceName, "bma250") == 0 || strcmp(e->deviceName, "bma150") == 0) { - printf("blacklisting %s input device\n", e->deviceName); + LOGI("Blacklisting input device: %s\n", e->deviceName); e->ignored = 1; } #else @@ -188,7 +188,7 @@ static int vk_init(struct ev *e) while (blacklist != NULL) { if (strcmp(e->deviceName, blacklist) == 0) { - printf("blacklisting %s input device\n", blacklist); + LOGI("Blacklisting input device: %s\n", blacklist); e->ignored = 1; } blacklist = strtok(NULL, "\n"); @@ -220,7 +220,7 @@ static int vk_init(struct ev *e) } if (e->vk_count % 6) { - printf("minui: %s is %d %% 6\n", vk_path, e->vk_count % 6); + LOGI("minui: %s is %d %% 6\n", vk_path, e->vk_count % 6); } e->vk_count /= 6; if (e->vk_count <= 0) @@ -255,7 +255,7 @@ static int vk_init(struct ev *e) if (strcmp(token[0], "0x01") != 0) { /* Java does string compare, so we do too. */ - printf("minui: %s: ignoring unknown virtual key type %s\n", vk_path, token[0]); + LOGI("minui: %s: ignoring unknown virtual key type %s\n", vk_path, token[0]); continue; } @@ -297,7 +297,7 @@ static void check_mouse(int fd, const char* deviceName) if(!test_bit(BTN_LEFT, bit[EV_KEY]) || !test_bit(BTN_RIGHT, bit[EV_KEY])) return; - printf("Found mouse '%s'\n", deviceName); + LOGI("Found mouse '%s'\n", deviceName); has_mouse = 1; } @@ -317,7 +317,9 @@ int ev_init(void) dir = opendir("/dev/input"); if(dir != 0) { while((de = readdir(dir))) { -// fprintf(stderr,"/dev/input/%s\n", de->d_name); +#ifdef _EVENT_LOGGING + fprintf(stderr,"/dev/input/%s\n", de->d_name); +#endif if(strncmp(de->d_name,"event",5)) continue; fd = openat(dirfd(dir), de->d_name, O_RDONLY); if(fd < 0) continue; @@ -617,8 +619,10 @@ static int vk_modify(struct ev *e, struct input_event *ev) } #ifdef _EVENT_LOGGING - if (ev->type == EV_SYN && ev->code == SYN_REPORT) printf("EV: %s => EV_SYN SYN_REPORT\n", e->deviceName); - if (ev->type == EV_SYN && ev->code == SYN_MT_REPORT) printf("EV: %s => EV_SYN SYN_MT_REPORT\n", e->deviceName); + if (ev->type == EV_SYN && ev->code == SYN_REPORT) + printf("EV: %s => EV_SYN SYN_REPORT\n", e->deviceName); + if (ev->type == EV_SYN && ev->code == SYN_MT_REPORT) + printf("EV: %s => EV_SYN SYN_MT_REPORT\n", e->deviceName); #endif // Discard the MT versions @@ -752,7 +756,7 @@ int ev_get(struct input_event *ev, int timeout_ms) stat("/dev/input", &st); if (st.st_mtime > lastInputMTime) { - printf("Reloading input devices\n"); + LOGI("Reloading input devices\n"); ev_exit(); ev_init(); lastInputMTime = st.st_mtime; |