static void key_handler(struct window *window, struct input *input, uint32_t time, uint32_t key, uint32_t unicode, enum wl_keyboard_key_state state, void *data) { struct view *view = data; if (state == WL_KEYBOARD_KEY_STATE_RELEASED) return; switch (key) { case KEY_SPACE: case KEY_PAGEDOWN: case KEY_RIGHT: case KEY_DOWN: view_page_down(view); break; case KEY_BACKSPACE: case KEY_PAGEUP: case KEY_LEFT: case KEY_UP: view_page_up(view); break; default: break; } }
static void key_handler(struct window *window, struct input *input, uint32_t time, uint32_t key, uint32_t unicode, uint32_t state, void *data) { struct view *view = data; if(!state) return; switch (key) { case KEY_F11: view->fullscreen ^= 1; window_set_fullscreen(window, view->fullscreen); break; case KEY_SPACE: case KEY_PAGEDOWN: case KEY_RIGHT: case KEY_DOWN: view_page_down(view); break; case KEY_BACKSPACE: case KEY_PAGEUP: case KEY_LEFT: case KEY_UP: view_page_up(view); break; default: break; } }
static void button_handler(struct widget *widget, struct input *input, uint32_t time, int button, int state, void *data) { struct view *view = data; if(!state) return; switch(button) { case 275: view_page_up(view); break; case 276: view_page_down(view); break; default: break; } }
static void button_handler(struct widget *widget, struct input *input, uint32_t time, uint32_t button, enum wl_pointer_button_state state, void *data) { struct view *view = data; if (state == WL_POINTER_BUTTON_STATE_RELEASED) return; switch(button) { case 275: view_page_up(view); break; case 276: view_page_down(view); break; default: break; } }