forked from enlightenment/enlightenment
keyboard move/resize no accept modifiers.
* Control: value * 2 * Alt: value / 2 SVN revision: 36302
This commit is contained in:
parent
77e8ea0a36
commit
cd2f6c6d44
|
@ -2685,6 +2685,23 @@ _e_border_action_restore_orig(E_Border *bd)
|
||||||
e_border_move_resize(bd, action_orig.x, action_orig.y, action_orig.width, action_orig.height);
|
e_border_move_resize(bd, action_orig.x, action_orig.y, action_orig.width, action_orig.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
_e_border_key_down_modifier_apply(int modifier, int value)
|
||||||
|
{
|
||||||
|
if (modifier & ECORE_X_MODIFIER_CTRL)
|
||||||
|
return value * 2;
|
||||||
|
else if (modifier & ECORE_X_MODIFIER_ALT)
|
||||||
|
{
|
||||||
|
value /= 2;
|
||||||
|
if (value)
|
||||||
|
return value;
|
||||||
|
else
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_e_border_action_move_timeout(void *data)
|
_e_border_action_move_timeout(void *data)
|
||||||
{
|
{
|
||||||
|
@ -2719,13 +2736,13 @@ _e_border_move_key_down(void *data, int type, void *event)
|
||||||
y = action_border->y;
|
y = action_border->y;
|
||||||
|
|
||||||
if (strcmp(ev->keysymbol, "Up") == 0)
|
if (strcmp(ev->keysymbol, "Up") == 0)
|
||||||
y -= e_config->border_keyboard.move.dy;
|
y -= _e_border_key_down_modifier_apply(ev->modifiers, e_config->border_keyboard.move.dy);
|
||||||
else if (strcmp(ev->keysymbol, "Down") == 0)
|
else if (strcmp(ev->keysymbol, "Down") == 0)
|
||||||
y += e_config->border_keyboard.move.dy;
|
y += _e_border_key_down_modifier_apply(ev->modifiers, e_config->border_keyboard.move.dy);
|
||||||
else if (strcmp(ev->keysymbol, "Left") == 0)
|
else if (strcmp(ev->keysymbol, "Left") == 0)
|
||||||
x -= e_config->border_keyboard.move.dx;
|
x -= _e_border_key_down_modifier_apply(ev->modifiers, e_config->border_keyboard.move.dx);
|
||||||
else if (strcmp(ev->keysymbol, "Right") == 0)
|
else if (strcmp(ev->keysymbol, "Right") == 0)
|
||||||
x += e_config->border_keyboard.move.dx;
|
x += _e_border_key_down_modifier_apply(ev->modifiers, e_config->border_keyboard.move.dx);
|
||||||
else if (strcmp(ev->keysymbol, "Return") == 0)
|
else if (strcmp(ev->keysymbol, "Return") == 0)
|
||||||
goto stop;
|
goto stop;
|
||||||
else if (strcmp(ev->keysymbol, "Escape") == 0)
|
else if (strcmp(ev->keysymbol, "Escape") == 0)
|
||||||
|
@ -2733,6 +2750,9 @@ _e_border_move_key_down(void *data, int type, void *event)
|
||||||
_e_border_action_restore_orig(action_border);
|
_e_border_action_restore_orig(action_border);
|
||||||
goto stop;
|
goto stop;
|
||||||
}
|
}
|
||||||
|
else if ((strncmp(ev->keysymbol, "Control", sizeof("Control") - 1) != 0) &&
|
||||||
|
(strncmp(ev->keysymbol, "Alt", sizeof("Alt") - 1) != 0))
|
||||||
|
goto stop;
|
||||||
|
|
||||||
e_border_move(action_border, x, y);
|
e_border_move(action_border, x, y);
|
||||||
_e_border_action_move_timeout_add();
|
_e_border_action_move_timeout_add();
|
||||||
|
@ -2823,13 +2843,13 @@ _e_border_resize_key_down(void *data, int type, void *event)
|
||||||
h = action_border->h;
|
h = action_border->h;
|
||||||
|
|
||||||
if (strcmp(ev->keysymbol, "Up") == 0)
|
if (strcmp(ev->keysymbol, "Up") == 0)
|
||||||
h -= e_config->border_keyboard.resize.dy;
|
h -= _e_border_key_down_modifier_apply(ev->modifiers, e_config->border_keyboard.resize.dy);
|
||||||
else if (strcmp(ev->keysymbol, "Down") == 0)
|
else if (strcmp(ev->keysymbol, "Down") == 0)
|
||||||
h += e_config->border_keyboard.resize.dy;
|
h += _e_border_key_down_modifier_apply(ev->modifiers, e_config->border_keyboard.resize.dy);
|
||||||
else if (strcmp(ev->keysymbol, "Left") == 0)
|
else if (strcmp(ev->keysymbol, "Left") == 0)
|
||||||
w -= e_config->border_keyboard.resize.dx;
|
w -= _e_border_key_down_modifier_apply(ev->modifiers, e_config->border_keyboard.resize.dx);
|
||||||
else if (strcmp(ev->keysymbol, "Right") == 0)
|
else if (strcmp(ev->keysymbol, "Right") == 0)
|
||||||
w += e_config->border_keyboard.resize.dx;
|
w += _e_border_key_down_modifier_apply(ev->modifiers, e_config->border_keyboard.resize.dx);
|
||||||
else if (strcmp(ev->keysymbol, "Return") == 0)
|
else if (strcmp(ev->keysymbol, "Return") == 0)
|
||||||
goto stop;
|
goto stop;
|
||||||
else if (strcmp(ev->keysymbol, "Escape") == 0)
|
else if (strcmp(ev->keysymbol, "Escape") == 0)
|
||||||
|
@ -2837,7 +2857,8 @@ _e_border_resize_key_down(void *data, int type, void *event)
|
||||||
_e_border_action_restore_orig(action_border);
|
_e_border_action_restore_orig(action_border);
|
||||||
goto stop;
|
goto stop;
|
||||||
}
|
}
|
||||||
else
|
else if ((strncmp(ev->keysymbol, "Control", sizeof("Control") - 1) != 0) &&
|
||||||
|
(strncmp(ev->keysymbol, "Alt", sizeof("Alt") - 1) != 0))
|
||||||
goto stop;
|
goto stop;
|
||||||
|
|
||||||
e_border_resize(action_border, w, h);
|
e_border_resize(action_border, w, h);
|
||||||
|
|
Loading…
Reference in New Issue