mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 08:00:42 -05:00
support diagonal keypad keybindings, from Dafydd Harries
2003-04-23 Havoc Pennington <hp@pobox.com> * src/keybindings.c (process_keyboard_move_grab): support diagonal keypad keybindings, from Dafydd Harries
This commit is contained in:
parent
ec9cf27a81
commit
75fa56391d
@ -1,3 +1,8 @@
|
|||||||
|
2003-04-23 Havoc Pennington <hp@pobox.com>
|
||||||
|
|
||||||
|
* src/keybindings.c (process_keyboard_move_grab): support
|
||||||
|
diagonal keypad keybindings, from Dafydd Harries
|
||||||
|
|
||||||
2003-04-21 Havoc Pennington <hp@redhat.com>
|
2003-04-21 Havoc Pennington <hp@redhat.com>
|
||||||
|
|
||||||
* purge HAVE_GTK_MULTIHEAD from the source code, not just from
|
* purge HAVE_GTK_MULTIHEAD from the source code, not just from
|
||||||
|
@ -1694,14 +1694,26 @@ process_keyboard_move_grab (MetaDisplay *display,
|
|||||||
else
|
else
|
||||||
incr = NORMAL_INCREMENT;
|
incr = NORMAL_INCREMENT;
|
||||||
|
|
||||||
|
if (keysym == XK_Escape)
|
||||||
|
{
|
||||||
|
/* End move and restore to original position */
|
||||||
|
meta_window_move_resize (display->grab_window,
|
||||||
|
TRUE,
|
||||||
|
display->grab_initial_window_pos.x,
|
||||||
|
display->grab_initial_window_pos.y,
|
||||||
|
display->grab_initial_window_pos.width,
|
||||||
|
display->grab_initial_window_pos.height);
|
||||||
|
}
|
||||||
|
|
||||||
/* When moving by increments, we still snap to edges if the move
|
/* When moving by increments, we still snap to edges if the move
|
||||||
* to the edge is smaller than the increment. This is because
|
* to the edge is smaller than the increment. This is because
|
||||||
* Shift + arrow to snap is sort of a hidden feature. This way
|
* Shift + arrow to snap is sort of a hidden feature. This way
|
||||||
* people using just arrows shouldn't get too frustrated.
|
* people using just arrows shouldn't get too frustrated.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
switch (keysym)
|
switch (keysym)
|
||||||
{
|
{
|
||||||
|
case XK_KP_Home:
|
||||||
|
case XK_KP_Prior:
|
||||||
case XK_Up:
|
case XK_Up:
|
||||||
case XK_KP_Up:
|
case XK_KP_Up:
|
||||||
edge = meta_window_find_next_horizontal_edge (window, FALSE);
|
edge = meta_window_find_next_horizontal_edge (window, FALSE);
|
||||||
@ -1712,6 +1724,8 @@ process_keyboard_move_grab (MetaDisplay *display,
|
|||||||
|
|
||||||
handled = TRUE;
|
handled = TRUE;
|
||||||
break;
|
break;
|
||||||
|
case XK_KP_End:
|
||||||
|
case XK_KP_Next:
|
||||||
case XK_Down:
|
case XK_Down:
|
||||||
case XK_KP_Down:
|
case XK_KP_Down:
|
||||||
edge = meta_window_find_next_horizontal_edge (window, TRUE);
|
edge = meta_window_find_next_horizontal_edge (window, TRUE);
|
||||||
@ -1722,6 +1736,12 @@ process_keyboard_move_grab (MetaDisplay *display,
|
|||||||
|
|
||||||
handled = TRUE;
|
handled = TRUE;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (keysym)
|
||||||
|
{
|
||||||
|
case XK_KP_Home:
|
||||||
|
case XK_KP_End:
|
||||||
case XK_Left:
|
case XK_Left:
|
||||||
case XK_KP_Left:
|
case XK_KP_Left:
|
||||||
edge = meta_window_find_next_vertical_edge (window, FALSE);
|
edge = meta_window_find_next_vertical_edge (window, FALSE);
|
||||||
@ -1732,6 +1752,8 @@ process_keyboard_move_grab (MetaDisplay *display,
|
|||||||
|
|
||||||
handled = TRUE;
|
handled = TRUE;
|
||||||
break;
|
break;
|
||||||
|
case XK_KP_Prior:
|
||||||
|
case XK_KP_Next:
|
||||||
case XK_Right:
|
case XK_Right:
|
||||||
case XK_KP_Right:
|
case XK_KP_Right:
|
||||||
edge = meta_window_find_next_vertical_edge (window, TRUE);
|
edge = meta_window_find_next_vertical_edge (window, TRUE);
|
||||||
@ -1740,19 +1762,6 @@ process_keyboard_move_grab (MetaDisplay *display,
|
|||||||
x = edge;
|
x = edge;
|
||||||
handled = TRUE;
|
handled = TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case XK_Escape:
|
|
||||||
/* End move and restore to original position */
|
|
||||||
meta_window_move_resize (display->grab_window,
|
|
||||||
TRUE,
|
|
||||||
display->grab_initial_window_pos.x,
|
|
||||||
display->grab_initial_window_pos.y,
|
|
||||||
display->grab_initial_window_pos.width,
|
|
||||||
display->grab_initial_window_pos.height);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (handled)
|
if (handled)
|
||||||
|
Loading…
Reference in New Issue
Block a user