From 70873aba6a1c58b472bcfe301d9e4e3bf3bf068a Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 4 Feb 2013 00:03:56 -0800 Subject: [PATCH] pspp-sheet-view: Make Control+Left, Control+Right go to ends of lines. John Darrington reported that, in Gnumeric, Control+Left goes to the first column and Control+Right goes to the last column. This commit changes the data sheet to do the same --- src/ui/gui/pspp-sheet-view.c | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/src/ui/gui/pspp-sheet-view.c b/src/ui/gui/pspp-sheet-view.c index a040954a40..0b99df2b02 100644 --- a/src/ui/gui/pspp-sheet-view.c +++ b/src/ui/gui/pspp-sheet-view.c @@ -1,5 +1,5 @@ /* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2011, 2012 Free Software Foundation, Inc. + Copyright (C) 2011, 2012, 2013 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -934,21 +934,21 @@ pspp_sheet_view_class_init (PsppSheetViewClass *class) G_TYPE_INT, -1); gtk_binding_entry_add_signal (binding_set[i], GDK_KP_Right, 0, "move-cursor", 2, - G_TYPE_ENUM, GTK_MOVEMENT_VISUAL_POSITIONS, + G_TYPE_ENUM, GTK_MOVEMENT_DISPLAY_LINE_ENDS, G_TYPE_INT, 1); gtk_binding_entry_add_signal (binding_set[i], GDK_KP_Left, 0, "move-cursor", 2, - G_TYPE_ENUM, GTK_MOVEMENT_VISUAL_POSITIONS, + G_TYPE_ENUM, GTK_MOVEMENT_DISPLAY_LINE_ENDS, G_TYPE_INT, -1); gtk_binding_entry_add_signal (binding_set[i], GDK_Right, GDK_CONTROL_MASK, "move-cursor", 2, - G_TYPE_ENUM, GTK_MOVEMENT_VISUAL_POSITIONS, + G_TYPE_ENUM, GTK_MOVEMENT_DISPLAY_LINE_ENDS, G_TYPE_INT, 1); gtk_binding_entry_add_signal (binding_set[i], GDK_Left, GDK_CONTROL_MASK, "move-cursor", 2, - G_TYPE_ENUM, GTK_MOVEMENT_VISUAL_POSITIONS, + G_TYPE_ENUM, GTK_MOVEMENT_DISPLAY_LINE_ENDS, G_TYPE_INT, -1); gtk_binding_entry_add_signal (binding_set[i], GDK_KP_Right, GDK_CONTROL_MASK, @@ -12420,6 +12420,24 @@ pspp_sheet_view_event (GtkWidget *widget, } break; + case GDK_CONTROL_MASK: + switch (event->keyval) + { + case GDK_Left: case GDK_KP_Left: + if (!is_all_selected (widget) && !is_at_left (widget)) + return FALSE; + break; + + case GDK_Right: case GDK_KP_Right: + if (!is_all_selected (widget) && !is_at_right (widget)) + return FALSE; + break; + + default: + return FALSE; + } + break; + default: return FALSE; } -- 2.30.2