static void disable_mousekeys (ClutterInputDeviceEvdev *device) { stop_mousekeys_move (device); /* Make sure we don't leave button pressed behind... */ if (device->mousekeys_btn_states[get_button_index (CLUTTER_BUTTON_PRIMARY)]) { device->mousekeys_btn = CLUTTER_BUTTON_PRIMARY; emulate_button_release (device); } if (device->mousekeys_btn_states[get_button_index (CLUTTER_BUTTON_MIDDLE)]) { device->mousekeys_btn = CLUTTER_BUTTON_MIDDLE; emulate_button_release (device); } if (device->mousekeys_btn_states[get_button_index (CLUTTER_BUTTON_SECONDARY)]) { device->mousekeys_btn = CLUTTER_BUTTON_SECONDARY; emulate_button_release (device); } if (device->mousekeys_virtual_device) g_clear_object (&device->mousekeys_virtual_device); }
String InputEventMouseButton::as_text() const { String button_index_string = ""; switch (get_button_index()) { case BUTTON_LEFT: button_index_string = "BUTTON_LEFT"; break; case BUTTON_RIGHT: button_index_string = "BUTTON_RIGHT"; break; case BUTTON_MIDDLE: button_index_string = "BUTTON_MIDDLE"; break; case BUTTON_WHEEL_UP: button_index_string = "BUTTON_WHEEL_UP"; break; case BUTTON_WHEEL_DOWN: button_index_string = "BUTTON_WHEEL_DOWN"; break; case BUTTON_WHEEL_LEFT: button_index_string = "BUTTON_WHEEL_LEFT"; break; case BUTTON_WHEEL_RIGHT: button_index_string = "BUTTON_WHEEL_RIGHT"; break; default: button_index_string = itos(get_button_index()); break; } return "InputEventMouseButton : button_index=" + button_index_string + ", pressed=" + (pressed ? "true" : "false") + ", position=(" + String(get_position()) + "), button_mask=" + itos(get_button_mask()) + ", doubleclick=" + (doubleclick ? "true" : "false"); }
static void emulate_button_release (ClutterInputDeviceEvdev *device) { gint btn = device->mousekeys_btn; if (device->mousekeys_btn_states[get_button_index (btn)] == CLUTTER_BUTTON_STATE_RELEASED) return; clutter_virtual_input_device_notify_button (device->mousekeys_virtual_device, g_get_monotonic_time (), btn, CLUTTER_BUTTON_STATE_RELEASED); device->mousekeys_btn_states[get_button_index (btn)] = CLUTTER_BUTTON_STATE_RELEASED; }
static void mute_volume_slider(struct button *b,struct event *ev) { struct button *slider = get_button_index((int)b->user_data); ev->y=b->y+b->h; set_volume_slider(slider,ev); return 0; }