Exemple #1
0
static void
input_method_keyboard_modifiers(void *data,
				struct wl_keyboard *wl_keyboard,
				uint32_t serial,
				uint32_t mods_depressed,
				uint32_t mods_latched,
				uint32_t mods_locked,
				uint32_t group)
{
	struct simple_im *keyboard = data;
	struct wl_input_method_context *context = keyboard->context;
	xkb_mod_mask_t mask;

	xkb_state_update_mask(keyboard->state, mods_depressed,
			      mods_latched, mods_locked, 0, 0, group);
	mask = xkb_state_serialize_mods(keyboard->state,
					XKB_STATE_MODS_DEPRESSED |
					XKB_STATE_MODS_LATCHED);

	keyboard->modifiers = 0;
	if (mask & keyboard->control_mask)
		keyboard->modifiers |= MOD_CONTROL_MASK;
	if (mask & keyboard->alt_mask)
		keyboard->modifiers |= MOD_ALT_MASK;
	if (mask & keyboard->shift_mask)
		keyboard->modifiers |= MOD_SHIFT_MASK;

	wl_input_method_context_modifiers(context, serial,
					  mods_depressed, mods_depressed,
					  mods_latched, group);
}
Exemple #2
0
static void
_ibus_input_ctx_key_release(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending)
{
   struct wkb_ibus_key *key = (struct wkb_ibus_key *) data;
   Eina_Bool ret = EINA_FALSE;

   if (msg)
     {
        _check_message_errors(msg);

        if (!eldbus_message_arguments_get(msg, "b", &ret))
           ERR("Error reading message arguments");
     }

   if (!ret)
     {
        INF("Key release was not handled by IBus");
        wl_input_method_context_key(wkb_ibus->input_ctx->wl_ctx,
                                    wkb_ibus->input_ctx->serial,
                                    0, key->code-8, WL_KEYBOARD_KEY_STATE_RELEASED);

        if (key->modifiers)
           wl_input_method_context_modifiers(wkb_ibus->input_ctx->wl_ctx,
                                             wkb_ibus->input_ctx->serial,
                                             0, 0, 0, 0);

     }
}