--- vte/src/marshal.list	2005-05-25 12:48:48.000000000 +0530
+++ vte-new/src/marshal.list	2005-05-25 12:46:16.000000000 +0530
@@ -5,3 +5,4 @@ VOID:INT
 VOID:INT,INT
 VOID:UINT,UINT
 VOID:OBJECT,OBJECT
+VOID:ENUM
--- vte/src/vte.h	2005-05-25 12:48:59.000000000 +0530
+++ vte-new/src/vte.h	2005-05-25 12:46:28.000000000 +0530
@@ -96,6 +96,8 @@ struct _VteTerminalClass {
 	void (*text_deleted)(VteTerminal* terminal);
 	void (*text_scrolled)(VteTerminal* terminal, gint delta);
 
+	void (*scroll_page)(VteTerminal* terminal, GtkScrollType type);
+
 	/* Padding for future expansion. */
 	void (*vte_reserved1)(void);
 	void (*vte_reserved2)(void);
@@ -137,6 +139,8 @@ struct _VteTerminalClass {
 	guint text_deleted_signal;
 	guint text_scrolled_signal;
 
+	guint scroll_page_signal;
+
 	guint reserved1;
 	guint reserved2;
 	guint reserved3;
--- vte/src/vte.c	2005-05-25 12:49:08.000000000 +0530
+++ vte-new/src/vte.c	2005-05-25 12:51:19.000000000 +0530
@@ -495,6 +495,7 @@ static void _vte_terminal_disconnect_pty
 static void vte_terminal_stop_processing (VteTerminal *terminal);
 static void vte_terminal_start_processing (VteTerminal *terminal);
 static gboolean vte_terminal_is_processing (VteTerminal *terminal);
+static void vte_scroll_page (VteTerminal *terminal, GtkScrollType type);
 
 /* Free a no-longer-used row data array. */
 static void
@@ -8535,41 +8536,6 @@ vte_terminal_key_press(GtkWidget *widget
 				suppress_meta_esc = TRUE;
 			}
 			break;
-		/* Keypad/motion keys. */
-		case GDK_KP_Page_Up:
-		case GDK_Page_Up:
-			if (terminal->pvt->modifiers & GDK_SHIFT_MASK) {
-				vte_terminal_scroll_pages(terminal, -1);
-				scrolled = TRUE;
-				handled = TRUE;
-				suppress_meta_esc = TRUE;
-			}
-			break;
-		case GDK_KP_Page_Down:
-		case GDK_Page_Down:
-			if (terminal->pvt->modifiers & GDK_SHIFT_MASK) {
-				vte_terminal_scroll_pages(terminal, 1);
-				scrolled = TRUE;
-				handled = TRUE;
-				suppress_meta_esc = TRUE;
-			}
-			break;
-		case GDK_KP_Home:
-		case GDK_Home:
-			if (terminal->pvt->modifiers & GDK_SHIFT_MASK) {
-				vte_terminal_maybe_scroll_to_top(terminal);
-				scrolled = TRUE;
-				handled = TRUE;
-			}
-			break;
-		case GDK_KP_End:
-		case GDK_End:
-			if (terminal->pvt->modifiers & GDK_SHIFT_MASK) {
-				vte_terminal_maybe_scroll_to_bottom(terminal);
-				scrolled = TRUE;
-				handled = TRUE;
-			}
-			break;
 		/* Let Shift +/- tweak the font, like XTerm does. */
 		case GDK_KP_Add:
 		case GDK_KP_Subtract:
@@ -14206,6 +14172,7 @@ vte_terminal_class_init(VteTerminalClass
 {
 	GObjectClass *gobject_class;
 	GtkWidgetClass *widget_class;
+	GtkBindingSet *binding_set;
 
 #ifdef VTE_DEBUG
 	if (_vte_debug_on(VTE_DEBUG_LIFECYCLE)) {
@@ -14272,6 +14239,8 @@ vte_terminal_class_init(VteTerminalClass
 	klass->text_deleted = NULL;
 	klass->text_scrolled = NULL;
 
+	klass->scroll_page = vte_scroll_page;
+
 	/* Register some signals of our own. */
 	klass->eof_signal =
 		g_signal_new("eof",
@@ -14516,6 +14485,16 @@ vte_terminal_class_init(VteTerminalClass
 			     NULL,
 			     _vte_marshal_VOID__INT,
 			     G_TYPE_NONE, 1, G_TYPE_INT);
+	klass->scroll_page_signal =
+		g_signal_new("scroll-page",
+			     G_OBJECT_CLASS_TYPE(klass),
+			     G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
+			     G_STRUCT_OFFSET(VteTerminalClass, scroll_page),
+			     NULL,
+			     NULL,
+			     _vte_marshal_VOID__ENUM,
+			     G_TYPE_NONE, 1,
+			     GTK_TYPE_SCROLL_TYPE);
 
 #ifdef VTE_DEBUG
 	/* Turn on debugging if we were asked to. */
@@ -14523,6 +14502,40 @@ vte_terminal_class_init(VteTerminalClass
 		_vte_debug_parse_string(getenv("VTE_DEBUG_FLAGS"));
 	}
 #endif
+
+	binding_set = gtk_binding_set_by_class(klass);
+	gtk_binding_entry_add_signal(binding_set, GDK_Home,
+				     GDK_SHIFT_MASK, "scroll-page",
+				     1, GTK_TYPE_SCROLL_TYPE,
+				     GTK_SCROLL_START);
+	gtk_binding_entry_add_signal(binding_set, GDK_KP_Home,
+				     GDK_SHIFT_MASK, "scroll-page",
+				     1, GTK_TYPE_SCROLL_TYPE,
+				     GTK_SCROLL_START);
+	gtk_binding_entry_add_signal(binding_set, GDK_End,
+				     GDK_SHIFT_MASK, "scroll-page",
+				     1, GTK_TYPE_SCROLL_TYPE,
+				     GTK_SCROLL_END);
+	gtk_binding_entry_add_signal(binding_set, GDK_KP_End,
+				     GDK_SHIFT_MASK, "scroll-page",
+				     1, GTK_TYPE_SCROLL_TYPE,
+				     GTK_SCROLL_END);
+	gtk_binding_entry_add_signal(binding_set, GDK_Page_Up,
+				     GDK_SHIFT_MASK, "scroll-page",
+				     1, GTK_TYPE_SCROLL_TYPE,
+				     GTK_SCROLL_PAGE_UP);
+	gtk_binding_entry_add_signal(binding_set, GDK_KP_Page_Up,
+				     GDK_SHIFT_MASK, "scroll-page",
+				     1, GTK_TYPE_SCROLL_TYPE,
+				     GTK_SCROLL_PAGE_UP);
+	gtk_binding_entry_add_signal(binding_set, GDK_Page_Down,
+				     GDK_SHIFT_MASK, "scroll-page",
+				     1, GTK_TYPE_SCROLL_TYPE,
+				     GTK_SCROLL_PAGE_DOWN);
+	gtk_binding_entry_add_signal(binding_set, GDK_KP_Page_Down,
+				     GDK_SHIFT_MASK, "scroll-page",
+				     1, GTK_TYPE_SCROLL_TYPE,
+				     GTK_SCROLL_PAGE_DOWN);
 }
 
 GtkType
@@ -15902,3 +15915,24 @@ coalesce_timeout (gpointer data)
 
 	return FALSE;
  }
+
+static void
+vte_scroll_page (VteTerminal *terminal, GtkScrollType type)
+{
+	switch (type) {
+	case GTK_SCROLL_START:
+				vte_terminal_maybe_scroll_to_top(terminal);
+				break;
+	case GTK_SCROLL_END:
+				vte_terminal_maybe_scroll_to_bottom(terminal);
+				break;
+	case GTK_SCROLL_PAGE_UP:
+				vte_terminal_scroll_pages(terminal, -1);
+				break;
+	case GTK_SCROLL_PAGE_DOWN:
+				vte_terminal_scroll_pages(terminal, 1);
+				break;
+	default:
+				break;
+	}
+} 
