text: Add support for forwarding key events
Allow an input method to forward (unfiltered) key and modifier events from the hardware keyboard to the client. Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
This commit is contained in:
committed by
Kristian Høgsberg
parent
466b9c1047
commit
337df952f8
+40
-1
@@ -454,6 +454,43 @@ input_method_context_grab_keyboard(struct wl_client *client,
|
||||
wl_keyboard_start_grab(keyboard, &context->grab);
|
||||
}
|
||||
|
||||
static void
|
||||
input_method_context_key(struct wl_client *client,
|
||||
struct wl_resource *resource,
|
||||
uint32_t serial,
|
||||
uint32_t time,
|
||||
uint32_t key,
|
||||
uint32_t state_w)
|
||||
{
|
||||
struct input_method_context *context = resource->data;
|
||||
struct weston_seat *seat = context->input_method->seat;
|
||||
struct wl_keyboard *keyboard = seat->seat.keyboard;
|
||||
struct wl_keyboard_grab *default_grab = &keyboard->default_grab;
|
||||
|
||||
default_grab->interface->key(default_grab, time, key, state_w);
|
||||
}
|
||||
|
||||
static void
|
||||
input_method_context_modifiers(struct wl_client *client,
|
||||
struct wl_resource *resource,
|
||||
uint32_t serial,
|
||||
uint32_t mods_depressed,
|
||||
uint32_t mods_latched,
|
||||
uint32_t mods_locked,
|
||||
uint32_t group)
|
||||
{
|
||||
struct input_method_context *context = resource->data;
|
||||
|
||||
struct weston_seat *seat = context->input_method->seat;
|
||||
struct wl_keyboard *keyboard = seat->seat.keyboard;
|
||||
struct wl_keyboard_grab *default_grab = &keyboard->default_grab;
|
||||
|
||||
default_grab->interface->modifiers(default_grab,
|
||||
serial, mods_depressed,
|
||||
mods_latched, mods_locked,
|
||||
group);
|
||||
}
|
||||
|
||||
static const struct input_method_context_interface input_method_context_implementation = {
|
||||
input_method_context_destroy,
|
||||
input_method_context_commit_string,
|
||||
@@ -461,7 +498,9 @@ static const struct input_method_context_interface input_method_context_implemen
|
||||
input_method_context_delete_surrounding_text,
|
||||
input_method_context_modifiers_map,
|
||||
input_method_context_keysym,
|
||||
input_method_context_grab_keyboard
|
||||
input_method_context_grab_keyboard,
|
||||
input_method_context_key,
|
||||
input_method_context_modifiers
|
||||
};
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user