forked from enlightenment/efl
ecore_wayland: Make modifiers correctly at once
SVN revision: 77546
This commit is contained in:
parent
7fe3d35994
commit
b111a5046e
|
@ -35,9 +35,7 @@
|
|||
# define BTN_BACK 0x116
|
||||
#endif
|
||||
|
||||
#define MOD_SHIFT_MASK 0x01
|
||||
#define MOD_ALT_MASK 0x02
|
||||
#define MOD_CONTROL_MASK 0x04
|
||||
#include <Ecore_Input.h>
|
||||
|
||||
Ecore_Wl_Dnd *glb_dnd = NULL;
|
||||
|
||||
|
@ -77,8 +75,6 @@ static void _ecore_wl_input_mouse_down_send(Ecore_Wl_Input *input, Ecore_Wl_Wind
|
|||
static void _ecore_wl_input_mouse_up_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsigned int timestamp);
|
||||
static void _ecore_wl_input_mouse_wheel_send(Ecore_Wl_Input *input, unsigned int axis, int value, unsigned int timestamp);
|
||||
|
||||
static unsigned int _ecore_wl_event_modifiers(unsigned int state);
|
||||
|
||||
/* static int _ecore_wl_input_keysym_to_string(unsigned int symbol, char *buffer, int len); */
|
||||
|
||||
/* wayland interfaces */
|
||||
|
@ -547,11 +543,11 @@ _ecore_wl_input_cb_keyboard_key(void *data, struct wl_keyboard *keyboard __UNUSE
|
|||
|
||||
/* The Ecore_Event_Modifiers don't quite match the X mask bits */
|
||||
if (mask & input->xkb.control_mask)
|
||||
input->modifiers |= MOD_CONTROL_MASK;
|
||||
input->modifiers |= ECORE_EVENT_MODIFIER_CTRL;
|
||||
if (mask & input->xkb.alt_mask)
|
||||
input->modifiers |= MOD_ALT_MASK;
|
||||
input->modifiers |= ECORE_EVENT_MODIFIER_ALT;
|
||||
if (mask & input->xkb.shift_mask)
|
||||
input->modifiers |= MOD_SHIFT_MASK;
|
||||
input->modifiers |= ECORE_EVENT_MODIFIER_SHIFT;
|
||||
|
||||
num = xkb_key_get_syms(input->xkb.state, code, &syms);
|
||||
if (num == 1) sym = syms[0];
|
||||
|
@ -597,7 +593,7 @@ _ecore_wl_input_cb_keyboard_key(void *data, struct wl_keyboard *keyboard __UNUSE
|
|||
e->window = win->id;
|
||||
e->event_window = win->id;
|
||||
e->timestamp = timestamp;
|
||||
e->modifiers = _ecore_wl_event_modifiers(input->modifiers);
|
||||
e->modifiers = input->modifiers;
|
||||
|
||||
if (state)
|
||||
ecore_event_add(ECORE_EVENT_KEY_DOWN, e, NULL, NULL);
|
||||
|
@ -975,7 +971,7 @@ _ecore_wl_input_mouse_move_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, uns
|
|||
ev->y = input->sy;
|
||||
/* ev->root.x = input->sx; */
|
||||
/* ev->root.y = input->sy; */
|
||||
ev->modifiers = _ecore_wl_event_modifiers(input->modifiers);
|
||||
ev->modifiers = input->modifiers;
|
||||
ev->multi.device = 0;
|
||||
ev->multi.radius = 1;
|
||||
ev->multi.radius_x = 1;
|
||||
|
@ -1007,7 +1003,7 @@ _ecore_wl_input_mouse_in_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsig
|
|||
ev->y = input->sy;
|
||||
/* ev->root.x = input->sx; */
|
||||
/* ev->root.y = input->sy; */
|
||||
ev->modifiers = _ecore_wl_event_modifiers(input->modifiers);
|
||||
ev->modifiers = input->modifiers;
|
||||
ev->timestamp = timestamp;
|
||||
|
||||
if (win)
|
||||
|
@ -1032,7 +1028,7 @@ _ecore_wl_input_mouse_out_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsi
|
|||
ev->y = input->sy;
|
||||
/* ev->root.x = input->sx; */
|
||||
/* ev->root.y = input->sy; */
|
||||
ev->modifiers = _ecore_wl_event_modifiers(input->modifiers);
|
||||
ev->modifiers = input->modifiers;
|
||||
ev->timestamp = timestamp;
|
||||
|
||||
if (win)
|
||||
|
@ -1093,7 +1089,7 @@ _ecore_wl_input_mouse_down_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, uns
|
|||
ev->y = input->sy;
|
||||
/* ev->root.x = input->sx; */
|
||||
/* ev->root.y = input->sy; */
|
||||
ev->modifiers = _ecore_wl_event_modifiers(input->modifiers);
|
||||
ev->modifiers = input->modifiers;
|
||||
|
||||
/* FIXME: Need to get these from wayland somehow */
|
||||
ev->double_click = 0;
|
||||
|
@ -1140,7 +1136,7 @@ _ecore_wl_input_mouse_up_send(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsig
|
|||
ev->y = input->sy;
|
||||
/* ev->root.x = input->sx; */
|
||||
/* ev->root.y = input->sy; */
|
||||
ev->modifiers = _ecore_wl_event_modifiers(input->modifiers);
|
||||
ev->modifiers = input->modifiers;
|
||||
|
||||
/* FIXME: Need to get these from wayland somehow */
|
||||
ev->double_click = 0;
|
||||
|
@ -1174,7 +1170,7 @@ _ecore_wl_input_mouse_wheel_send(Ecore_Wl_Input *input, unsigned int axis, int v
|
|||
if (!(ev = malloc(sizeof(Ecore_Event_Mouse_Wheel)))) return;
|
||||
|
||||
ev->timestamp = timestamp;
|
||||
ev->modifiers = _ecore_wl_event_modifiers(input->modifiers);
|
||||
ev->modifiers = input->modifiers;
|
||||
ev->x = input->sx;
|
||||
ev->y = input->sy;
|
||||
/* ev->root.x = input->sx; */
|
||||
|
@ -1205,21 +1201,6 @@ _ecore_wl_input_mouse_wheel_send(Ecore_Wl_Input *input, unsigned int axis, int v
|
|||
ecore_event_add(ECORE_EVENT_MOUSE_WHEEL, ev, NULL, NULL);
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
_ecore_wl_event_modifiers(unsigned int state)
|
||||
{
|
||||
unsigned int modifiers = 0;
|
||||
|
||||
if (state & MOD_SHIFT_MASK)
|
||||
modifiers |= ECORE_EVENT_MODIFIER_SHIFT;
|
||||
|
||||
if (state & MOD_CONTROL_MASK)
|
||||
modifiers |= ECORE_EVENT_MODIFIER_CTRL;
|
||||
|
||||
if (state & MOD_ALT_MASK)
|
||||
modifiers |= ECORE_EVENT_MODIFIER_ALT;
|
||||
}
|
||||
|
||||
void
|
||||
_ecore_wl_input_set_selection(Ecore_Wl_Input *input, struct wl_data_source *source)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue