Move the modifiers to a input device getter function.
}
static void
-key_handler(struct window *window, uint32_t key, uint32_t sym,
- uint32_t state, uint32_t modifiers, void *data)
+key_handler(struct window *window, struct input *input, uint32_t time,
+ uint32_t key, uint32_t sym, uint32_t state, void *data)
{
struct resizor *resizor = data;
}
static void
-key_handler(struct window *window, uint32_t key, uint32_t sym,
- uint32_t state, uint32_t modifiers, void *data)
+static void
+key_handler(struct window *window, struct input *input, uint32_t time,
+ uint32_t key, uint32_t sym, uint32_t state, void *data)
{
struct terminal *terminal = data;
char ch[MAX_RESPONSE];
+ uint32_t modifiers;
int len = 0;
+ modifiers = input_get_modifiers(input);
+ if ((modifiers & WINDOW_MODIFIER_CONTROL) &&
+ (modifiers & WINDOW_MODIFIER_SHIFT) &&
+ state && handle_bound_key(terminal, input, sym, 0))
+ return;
+
switch (sym) {
case XK_F11:
if (!state)
}
static void
-key_handler(struct window *window, uint32_t key, uint32_t unicode,
- uint32_t state, uint32_t modifiers, void *data)
+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;
input->modifiers &= ~d->xkb->map->modmap[code];
if (window->key_handler)
- (*window->key_handler)(window, key, sym, state,
- input->modifiers, window->user_data);
+ (*window->key_handler)(window, input, time, key, sym, state,
+ window->user_data);
}
static void
return input->input_device;
}
+uint32_t
+input_get_modifiers(struct input *input)
+{
+ return input->modifiers;
+}
+
struct wl_drag *
window_create_drag(struct window *window)
{
void *data);
typedef void (*window_redraw_handler_t)(struct window *window, void *data);
typedef void (*window_frame_handler_t)(struct window *window, uint32_t frame, uint32_t timestamp, void *data);
-typedef void (*window_key_handler_t)(struct window *window, uint32_t key, uint32_t unicode,
- uint32_t state, uint32_t modifiers, void *data);
+typedef void (*window_key_handler_t)(struct window *window, struct input *input,
+ uint32_t time, uint32_t key, uint32_t unicode,
+ uint32_t state, void *data);
typedef void (*window_keyboard_focus_handler_t)(struct window *window,
struct input *device, void *data);
void
input_get_position(struct input *input, int32_t *x, int32_t *y);
+uint32_t
+input_get_modifiers(struct input *input);
+
struct wl_input_device *
input_get_input_device(struct input *input);