From 2692e11168fec90673d21caf2c811cadbf63d2be Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Fri, 18 Jan 2019 12:48:15 +0100 Subject: libinput: mouse button support --- fbi.c | 2 ++ kbd.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/fbi.c b/fbi.c index 2d76f9c..9dab5b6 100644 --- a/fbi.c +++ b/fbi.c @@ -1544,9 +1544,11 @@ int main(int argc, char *argv[]) cleanup_and_exit(0); break; case KEY_PAGEDOWN: + case BTN_LEFT: fcurrent = flist_next(fcurrent,0,1); break; case KEY_PAGEUP: + case BTN_RIGHT: fcurrent = flist_prev(fcurrent,1); break; case -1: /* timeout */ diff --git a/kbd.c b/kbd.c index 9ef8d3e..ff29c6e 100644 --- a/kbd.c +++ b/kbd.c @@ -275,6 +275,7 @@ int kbd_read(char *buf, uint32_t len, { struct libinput_event *evt; struct libinput_event_keyboard *kbd; + struct libinput_event_pointer *ptr; int rc; memset(buf, 0, len); @@ -294,6 +295,11 @@ int kbd_read(char *buf, uint32_t len, /* TODO: track modifier state */ /* TODO: fill buf with typed chars */ break; + case LIBINPUT_EVENT_POINTER_BUTTON: + ptr = libinput_event_get_pointer_event(evt); + if (libinput_event_pointer_get_button_state(ptr)) + *keycode = libinput_event_pointer_get_button(ptr); + break; default: /* ignore event */ break; -- cgit