diff -r -u gtk+-2.6.10/gdk/x11/gdkevents-x11.c gtk+-2.6.10.mod/gdk/x11/gdkevents-x11.c
--- gtk+-2.6.10/gdk/x11/gdkevents-x11.c	2005-08-18 10:10:56.000000000 -0400
+++ gtk+-2.6.10.mod/gdk/x11/gdkevents-x11.c	2005-10-18 16:00:04.000000000 -0400
@@ -2763,6 +2763,7 @@
   { "Gtk/ButtonImages", "gtk-button-images" },
   { "Gtk/MenuImages", "gtk-menu-images" },
   { "Gtk/MenuBarAccel", "gtk-menu-bar-accel" },
+  { "Gtk/PhoneKeypadMode", "gtk-phone-keypad-mode"},
   { "Xft/Antialias", "gtk-xft-antialias" },
   { "Xft/Hinting", "gtk-xft-hinting" },
   { "Xft/HintStyle", "gtk-xft-hintstyle" },

diff -r -u gtk+-2.6.10/gtk/gtkcombobox.c gtk+-2.6.10.mod/gtk/gtkcombobox.c
--- gtk+-2.6.10/gtk/gtkcombobox.c	2005-08-18 10:10:57.000000000 -0400
+++ gtk+-2.6.10.mod/gtk/gtkcombobox.c	2005-10-27 14:55:43.000000000 -0400
@@ -18,6 +18,7 @@
  */
 
 #include <config.h>
+#ifndef GTK_NO_COMBOBOX
 #include "gtkcombobox.h"
 
 #include "gtkarrow.h"
@@ -3467,6 +3468,7 @@
   gboolean found;
   GtkTreeIter iter;
   GtkTreeIter new_iter;
+  gboolean keypad;
 
   if (combo_box->priv->model == NULL)
     return FALSE;
@@ -3512,6 +3514,28 @@
     case GDK_KP_End:
       found = tree_last (combo_box, combo_box->priv->model, &new_iter, FALSE);
       break;
+    case GDK_Left:
+    case GDK_KP_Left:
+      g_object_get(gtk_settings_get_default(), "gtk-phone-keypad-mode", &keypad, NULL);
+      if (keypad)
+      {
+      	  if (gtk_widget_get_direction(GTK_WIDGET(combo_box)) == GTK_TEXT_DIR_RTL)
+        	  gtk_widget_child_focus (gtk_widget_get_toplevel (combo_box), GTK_DIR_TAB_FORWARD);
+          else
+                  gtk_widget_child_focus (gtk_widget_get_toplevel (combo_box), GTK_DIR_TAB_BACKWARD);
+       }
+       break;
+    case GDK_Right:
+    case GDK_KP_Right:
+       g_object_get(gtk_settings_get_default(), "gtk-phone-keypad-mode", &keypad, NULL);
+       if (keypad)
+       {
+               if (gtk_widget_get_direction(GTK_WIDGET(combo_box)) == GTK_TEXT_DIR_RTL)
+                               gtk_widget_child_focus (gtk_widget_get_toplevel (combo_box), GTK_DIR_TAB_BACKWARD);
+               else
+                               gtk_widget_child_focus (gtk_widget_get_toplevel (combo_box), GTK_DIR_TAB_FORWARD);
+       }
+       break;
     default:
       return FALSE;
     }
@@ -5175,3 +5199,4 @@
 
 #define __GTK_COMBO_BOX_C__
 #include "gtkaliasdef.c"
+#endif

diff -r -u gtk+-2.6.10/gtk/gtkcontainer.c gtk+-2.6.10.mod/gtk/gtkcontainer.c
--- gtk+-2.6.10/gtk/gtkcontainer.c	2005-08-18 10:10:57.000000000 -0400
+++ gtk+-2.6.10.mod/gtk/gtkcontainer.c	2005-11-02 17:22:13.000000000 -0500
@@ -25,6 +25,7 @@
  */
 
 #include <config.h>
+#ifndef GTK_NO_CONTAINER
 #include <stdarg.h>
 #include <string.h>
 #include <stdlib.h>
@@ -1984,7 +1985,8 @@
 			   GtkWidget        *old_focus)
 {
   children = g_list_copy (children);
-  
+  gboolean keypad;
+ 
   switch (direction)
     {
     case GTK_DIR_TAB_FORWARD:
@@ -1994,9 +1996,29 @@
     case GTK_DIR_DOWN:
       return gtk_container_focus_sort_up_down (container, children, direction, old_focus);
     case GTK_DIR_LEFT:
+	g_object_get(gtk_settings_get_default(), "gtk-phone-keypad-mode", &keypad, NULL);
+       if (keypad)
+       {
+               if (gtk_widget_get_direction(GTK_WIDGET (container)) == GTK_TEXT_DIR_RTL)
+                       return gtk_container_focus_sort_tab (container, children, GTK_DIR_TAB_FORWARD, old_focus);
+               else
+                       return gtk_container_focus_sort_tab (container, children, GTK_DIR_TAB_BACKWARD, old_focus);
+       }
+       else
+               return gtk_container_focus_sort_left_right (container, children, direction, old_focus);
+
     case GTK_DIR_RIGHT:
-      return gtk_container_focus_sort_left_right (container, children, direction, old_focus);
-    }
+ 	g_object_get(gtk_settings_get_default(), "gtk-phone-keypad-mode", &keypad, NULL);
+       if (keypad)
+       {
+               if (gtk_widget_get_direction(GTK_WIDGET (container)) == GTK_TEXT_DIR_RTL)
+                       return gtk_container_focus_sort_tab (container, children, GTK_DIR_TAB_BACKWARD, old_focus);
+               else
+                       return gtk_container_focus_sort_tab (container, children, GTK_DIR_TAB_FORWARD, old_focus);
+       }
+       else
+               return gtk_container_focus_sort_left_right (container, children, direction, old_focus);
+      }
 
   g_assert_not_reached ();
 
@@ -2010,6 +2032,7 @@
 {
   GtkWidget *focus_child;
   GtkWidget *child;
+  gint leng;
 
   focus_child = container->focus_child;
 
@@ -2018,6 +2041,8 @@
       child = children->data;
       children = children->next;
 
+	gtk_widget_class_path(child, &leng, NULL, NULL );
+
       if (!child)
 	continue;
       
@@ -2027,15 +2052,17 @@
             {
               focus_child = NULL;
 
-		if (gtk_widget_child_focus (child, direction))
+		if (gtk_widget_child_focus (child, direction)){
 		  return TRUE;
+		}
             }
         }
       else if (GTK_WIDGET_DRAWABLE (child) &&
                gtk_widget_is_ancestor (child, GTK_WIDGET (container)))
         {
-          if (gtk_widget_child_focus (child, direction))
+          if (gtk_widget_child_focus (child, direction)){
             return TRUE;
+		}
         }
     }
 
@@ -2466,3 +2493,4 @@
 
 #define __GTK_CONTAINER_C__
 #include "gtkaliasdef.c"
+#endif

diff -r -u gtk+-2.6.10/gtk/gtkentry.c gtk+-2.6.10.mod/gtk/gtkentry.c
--- gtk+-2.6.10/gtk/gtkentry.c	2005-08-18 10:10:57.000000000 -0400
+++ gtk+-2.6.10.mod/gtk/gtkentry.c	2005-10-27 14:55:43.000000000 -0400
@@ -25,6 +25,7 @@
  */
 
 #include <config.h>
+#ifndef GTK_NO_ENTRY
 #include <string.h>
 
 #include <pango/pango.h>
@@ -2335,6 +2336,9 @@
 		       gint            count,
 		       gboolean        extend_selection)
 {
+       gboolean keypad;
+       gint before;
+
   gint new_pos = entry->current_pos;
 
   gtk_entry_reset_im_context (entry);
@@ -2385,7 +2389,22 @@
 	  new_pos = gtk_entry_move_logically (entry, new_pos, count);
 	  break;
 	case GTK_MOVEMENT_VISUAL_POSITIONS:
-	  new_pos = gtk_entry_move_visually (entry, new_pos, count);
+	  before = new_pos;
+          new_pos = gtk_entry_move_visually (entry, new_pos, count);
+               g_object_get(gtk_settings_get_default(), "gtk-phone-keypad-mode", &keypad, NULL);
+               if (keypad){
+                       if (before == new_pos)
+                       {
+                       //GtkDirectionType dir = (before == 0) ? GTK_DIR_LEFT : GTK_DIR_RIGHT;
+                       GtkDirectionType dir = GTK_DIR_TAB_FORWARD;
+                       if ((count < 0 && gtk_widget_get_direction(GTK_WIDGET(entry)) != GTK_TEXT_DIR_RTL) ||
+                       (count > 0 && gtk_widget_get_direction(GTK_WIDGET(entry)) == GTK_TEXT_DIR_RTL))
+                               dir = GTK_DIR_TAB_BACKWARD;
+
+                       gtk_widget_child_focus (gtk_widget_get_toplevel (entry), dir);
+
+                       }
+               }
 	  break;
 	case GTK_MOVEMENT_WORDS:
 	  while (count > 0)
@@ -5394,3 +5413,4 @@
 
 #define __GTK_ENTRY_C__
 #include "gtkaliasdef.c"
+#endif

diff -r -u gtk+-2.6.10/gtk/gtkhscale.c gtk+-2.6.10.mod/gtk/gtkhscale.c
--- gtk+-2.6.10/gtk/gtkhscale.c	2005-08-18 10:10:58.000000000 -0400
+++ gtk+-2.6.10.mod/gtk/gtkhscale.c	2005-10-27 14:55:44.000000000 -0400
@@ -25,10 +25,13 @@
  */
 
 #include <config.h>
+#ifndef GTK_NO_HSCALE
 #include <math.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include "gtkhscale.h"
+#include "gdk/gdkkeysyms.h"
+#include "gtkbindings.h"
 #include "gtkintl.h"
 #include "gtkalias.h"
 
@@ -38,6 +41,8 @@
 static void     gtk_hscale_init             (GtkHScale      *hscale);
 static gboolean gtk_hscale_expose           (GtkWidget      *widget,
                                              GdkEventExpose *event);
+static gint gtk_hscale_key_press_event      (GtkWidget        *widget,
+                                                GdkEventKey      *event);
 
 static void     gtk_hscale_get_layout_offsets (GtkScale       *scale,
                                                gint           *x,
@@ -76,6 +81,7 @@
   GtkWidgetClass *widget_class;
   GtkRangeClass *range_class;
   GtkScaleClass *scale_class;
+  GtkBindingSet  *binding_set;
   
   widget_class = GTK_WIDGET_CLASS (class);
   range_class = GTK_RANGE_CLASS (class);
@@ -88,6 +94,25 @@
   scale_class->get_layout_offsets = gtk_hscale_get_layout_offsets;
   
   widget_class->expose_event = gtk_hscale_expose;
+  widget_class->key_press_event = gtk_hscale_key_press_event;
+
+  binding_set = gtk_binding_set_by_class (class);
+
+  gtk_binding_entry_add_signal (binding_set, GDK_Left, 0,
+                                "move_slider", 1,
+                                GTK_TYPE_SCROLL_TYPE, GTK_SCROLL_STEP_LEFT);
+
+  gtk_binding_entry_add_signal (binding_set, GDK_KP_Left, 0,
+                                "move_slider", 1,
+                                GTK_TYPE_SCROLL_TYPE, GTK_SCROLL_STEP_LEFT);
+
+  gtk_binding_entry_add_signal (binding_set, GDK_Right, 0,
+                                "move_slider", 1,
+                                GTK_TYPE_SCROLL_TYPE, GTK_SCROLL_STEP_RIGHT);
+
+  gtk_binding_entry_add_signal (binding_set, GDK_KP_Right, 0,
+                                "move_slider", 1,
+                                GTK_TYPE_SCROLL_TYPE, GTK_SCROLL_STEP_RIGHT);
 }
 
 static void
@@ -197,6 +222,30 @@
   return FALSE;
 }
 
+static gint
+gtk_hscale_key_press_event (GtkWidget *widget, GdkEventKey *event)
+{
+
+  if (GTK_WIDGET_CLASS (parent_class)->key_press_event &&
+           GTK_WIDGET_CLASS (parent_class)->key_press_event (widget, event))
+   return TRUE;
+
+  switch (event->keyval)
+    {
+    case GDK_Up:
+    case GDK_KP_Up:
+	 gtk_widget_child_focus (gtk_widget_get_toplevel (widget), GTK_DIR_TAB_BACKWARD);
+         break;
+    case GDK_Down:
+    case GDK_KP_Down:
+	 gtk_widget_child_focus (gtk_widget_get_toplevel (widget), GTK_DIR_TAB_FORWARD);
+         break;
+    default:
+      return FALSE;
+    }
+  return TRUE;
+}
+
 static void     
 gtk_hscale_get_layout_offsets (GtkScale *scale,
                                gint     *x,
@@ -265,3 +314,4 @@
 
 #define __GTK_HSCALE_C__
 #include "gtkaliasdef.c"
+#endif

diff -r -u gtk+-2.6.10/gtk/gtkiconview.c gtk+-2.6.10.mod/gtk/gtkiconview.c
--- gtk+-2.6.10/gtk/gtkiconview.c	2005-08-18 10:10:58.000000000 -0400
+++ gtk+-2.6.10.mod/gtk/gtkiconview.c	2005-10-27 14:55:44.000000000 -0400
@@ -18,6 +18,7 @@
  */
 
 #include <config.h>
+#ifndef GTK_NO_ICONVIEW
 #include <string.h>
 
 #include <atk/atk.h>
@@ -2902,13 +2903,13 @@
 {
   GtkIconViewItem *item;
   gboolean dirty = FALSE;
+  GList *list;
   
   if (!GTK_WIDGET_HAS_FOCUS (icon_view))
     return;
   
   if (!icon_view->priv->cursor_item)
     {
-      GList *list;
 
       if (count > 0)
 	list = icon_view->priv->items;
@@ -2923,7 +2924,17 @@
 		      0, count);
 
   if (!item)
-    return;
+  {
+        int idx = icon_view->priv->cursor_item->index;
+        idx = count > 0 ? idx + 1 : idx - 1;
+        list = g_list_nth (icon_view->priv->items, idx);
+	if (list)
+	  item = list->data;
+  	else if (count > 0)
+	  item = icon_view->priv->items->data;
+	else
+	  item = g_list_last(icon_view->priv->items)->data;
+   }
 
   if (icon_view->priv->ctrl_pressed ||
       !icon_view->priv->shift_pressed ||
@@ -2931,8 +2942,11 @@
       icon_view->priv->selection_mode != GTK_SELECTION_MULTIPLE)
     icon_view->priv->anchor_item = item;
 
+
   gtk_icon_view_set_cursor_item (icon_view, item);
 
+
+
   if (!icon_view->priv->ctrl_pressed &&
       icon_view->priv->selection_mode != GTK_SELECTION_NONE)
     {
@@ -6254,3 +6268,4 @@
 
 #define __GTK_ICON_VIEW_C__
 #include "gtkaliasdef.c"
+#endif

diff -r -u gtk+-2.6.10/gtk/gtkradiobutton.c gtk+-2.6.10.mod/gtk/gtkradiobutton.c
--- gtk+-2.6.10/gtk/gtkradiobutton.c	2005-08-18 10:10:58.000000000 -0400
+++ gtk+-2.6.10.mod/gtk/gtkradiobutton.c	2005-10-27 14:55:45.000000000 -0400
@@ -25,6 +25,7 @@
  */
 
 #include <config.h>
+#ifndef GTK_NO_RADIOBUTTON
 #include "gtklabel.h"
 #include "gtkmarshalers.h"
 #include "gtkradiobutton.h"
@@ -41,8 +42,8 @@
 static void     gtk_radio_button_class_init     (GtkRadioButtonClass *klass);
 static void     gtk_radio_button_init           (GtkRadioButton      *radio_button);
 static void     gtk_radio_button_destroy        (GtkObject           *object);
-static gboolean gtk_radio_button_focus          (GtkWidget           *widget,
-						 GtkDirectionType     direction);
+//static gboolean gtk_radio_button_focus          (GtkWidget           *widget,
+//						 GtkDirectionType     direction);
 static void     gtk_radio_button_clicked        (GtkButton           *button);
 static void     gtk_radio_button_draw_indicator (GtkCheckButton      *check_button,
 						 GdkRectangle        *area);
@@ -116,7 +117,7 @@
 							G_PARAM_WRITABLE));
   object_class->destroy = gtk_radio_button_destroy;
 
-  widget_class->focus = gtk_radio_button_focus;
+  //widget_class->focus = gtk_radio_button_focus;
 
   button_class->clicked = gtk_radio_button_clicked;
 
@@ -461,6 +462,7 @@
     return (x1 < x2) ? -1 : 1;
 }
 
+/*
 static gboolean
 gtk_radio_button_focus (GtkWidget         *widget,
 			GtkDirectionType   direction)
@@ -468,9 +470,9 @@
   GtkRadioButton *radio_button = GTK_RADIO_BUTTON (widget);
   GSList *tmp_slist;
 
-  /* Radio buttons with draw_indicator unset focus "normally", since
-   * they look like buttons to the user.
-   */
+  // Radio buttons with draw_indicator unset focus "normally", since
+  //  they look like buttons to the user.
+   
   if (!GTK_TOGGLE_BUTTON (widget)->draw_indicator)
     return GTK_WIDGET_CLASS (parent_class)->focus (widget, direction);
   
@@ -495,11 +497,10 @@
 	case GTK_DIR_DOWN:
 	  focus_list = g_slist_sort_with_data (focus_list, up_down_compare, toplevel);
 	  break;
+	  return FALSE;
 	}
-
       if (direction == GTK_DIR_LEFT || direction == GTK_DIR_UP)
 	focus_list = g_slist_reverse (focus_list);
-
       tmp_list = g_slist_find (focus_list, widget);
 
       if (tmp_list)
@@ -552,10 +553,10 @@
     {
       GtkRadioButton *selected_button = NULL;
       
-      /* We accept the focus if, we don't have the focus and
-       *  - we are the currently active button in the group
-       *  - there is no currently active radio button.
-       */
+       //We accept the focus if, we don't have the focus and
+       // - we are the currently active button in the group
+       //  - there is no currently active radio button.
+       
       
       tmp_slist = radio_button->group;
       while (tmp_slist)
@@ -572,6 +573,7 @@
       return TRUE;
     }
 }
+*/
 
 static void
 gtk_radio_button_clicked (GtkButton *button)
@@ -743,3 +745,4 @@
 
 #define __GTK_RADIO_BUTTON_C__
 #include "gtkaliasdef.c"
+#endif

diff -r -u gtk+-2.6.10/gtk/gtkscale.c gtk+-2.6.10.mod/gtk/gtkscale.c
--- gtk+-2.6.10/gtk/gtkscale.c	2005-08-18 10:10:59.000000000 -0400
+++ gtk+-2.6.10.mod/gtk/gtkscale.c	2005-10-27 14:55:45.000000000 -0400
@@ -26,6 +26,7 @@
  */
 
 #include <config.h>
+#ifndef GTK_NO_SCALE
 #include <math.h>
 #include "gtkintl.h"
 #include "gtkscale.h"
@@ -217,50 +218,50 @@
   
   binding_set = gtk_binding_set_by_class (class);
 
-  add_slider_binding (binding_set, GDK_Left, 0,
-                      GTK_SCROLL_STEP_LEFT);
+  /*add_slider_binding (binding_set, GDK_Left, 0,
+                      GTK_SCROLL_STEP_LEFT); */
 
   add_slider_binding (binding_set, GDK_Left, GDK_CONTROL_MASK,
                       GTK_SCROLL_PAGE_LEFT);
 
-  add_slider_binding (binding_set, GDK_KP_Left, 0,
-                      GTK_SCROLL_STEP_LEFT);
+  /*add_slider_binding (binding_set, GDK_KP_Left, 0,
+                      GTK_SCROLL_STEP_LEFT); */
 
   add_slider_binding (binding_set, GDK_KP_Left, GDK_CONTROL_MASK,
                       GTK_SCROLL_PAGE_LEFT);
 
-  add_slider_binding (binding_set, GDK_Right, 0,
-                      GTK_SCROLL_STEP_RIGHT);
+  /*add_slider_binding (binding_set, GDK_Right, 0,
+                      GTK_SCROLL_STEP_RIGHT);*/
 
   add_slider_binding (binding_set, GDK_Right, GDK_CONTROL_MASK,
                       GTK_SCROLL_PAGE_RIGHT);
 
-  add_slider_binding (binding_set, GDK_KP_Right, 0,
-                      GTK_SCROLL_STEP_RIGHT);
+  /*add_slider_binding (binding_set, GDK_KP_Right, 0,
+                      GTK_SCROLL_STEP_RIGHT);*/
 
   add_slider_binding (binding_set, GDK_KP_Right, GDK_CONTROL_MASK,
                       GTK_SCROLL_PAGE_RIGHT);
 
-  add_slider_binding (binding_set, GDK_Up, 0,
-                      GTK_SCROLL_STEP_UP);
+  /*add_slider_binding (binding_set, GDK_Up, 0,
+                      GTK_SCROLL_STEP_UP); */
 
   add_slider_binding (binding_set, GDK_Up, GDK_CONTROL_MASK,
                       GTK_SCROLL_PAGE_UP);
 
-  add_slider_binding (binding_set, GDK_KP_Up, 0,
-                      GTK_SCROLL_STEP_UP);
+  /*add_slider_binding (binding_set, GDK_KP_Up, 0,
+                      GTK_SCROLL_STEP_UP); */
 
   add_slider_binding (binding_set, GDK_KP_Up, GDK_CONTROL_MASK,
                       GTK_SCROLL_PAGE_UP);
 
-  add_slider_binding (binding_set, GDK_Down, 0,
-                      GTK_SCROLL_STEP_DOWN);
+  /*add_slider_binding (binding_set, GDK_Down, 0,
+                      GTK_SCROLL_STEP_DOWN);*/
 
   add_slider_binding (binding_set, GDK_Down, GDK_CONTROL_MASK,
                       GTK_SCROLL_PAGE_DOWN);
 
-  add_slider_binding (binding_set, GDK_KP_Down, 0,
-                      GTK_SCROLL_STEP_DOWN);
+  /*add_slider_binding (binding_set, GDK_KP_Down, 0,
+                      GTK_SCROLL_STEP_DOWN);*/
 
   add_slider_binding (binding_set, GDK_KP_Down, GDK_CONTROL_MASK,
                       GTK_SCROLL_PAGE_DOWN);
@@ -750,3 +751,4 @@
 
 #define __GTK_SCALE_C__
 #include "gtkaliasdef.c"
+#endif

diff -r -u gtk+-2.6.10/gtk/gtksettings.c gtk+-2.6.10.mod/gtk/gtksettings.c
--- gtk+-2.6.10/gtk/gtksettings.c	2005-08-18 10:10:59.000000000 -0400
+++ gtk+-2.6.10.mod/gtk/gtksettings.c	2005-10-27 14:55:45.000000000 -0400
@@ -17,6 +17,7 @@
  */
 
 #include <config.h>
+#ifndef GTK_NO_SETTINGS
 #include "gtkmodules.h"
 #include "gtksettings.h"
 #include "gtkrc.h"
@@ -72,7 +73,8 @@
   PROP_XFT_RGBA,
   PROP_XFT_DPI,
 #endif
-  PROP_ALTERNATIVE_BUTTON_ORDER
+  PROP_ALTERNATIVE_BUTTON_ORDER,
+  PROP_PHONE_KEYPAD_MODE
 };
 
 
@@ -435,6 +437,14 @@
 								   G_PARAM_READWRITE),
                                              NULL);
   g_assert (result == PROP_ALTERNATIVE_BUTTON_ORDER);
+  result = settings_install_property_parser(class, g_param_spec_boolean ("gtk-phone-keypad-mode",
+                                                                 P_("Phone keypad mode"),
+                                                                 P_("Whether the key device is phone keypad or normal keyboard"),
+                                                                 FALSE,
+                                                                 G_PARAM_READWRITE),
+                                                                 NULL);
+  g_assert(result == PROP_PHONE_KEYPAD_MODE);
+
 }
 
 static void
@@ -630,6 +640,9 @@
       gtk_rc_reset_styles (GTK_SETTINGS (object));
       break;
 #endif /* GDK_WINDOWING_X11 */
+    case PROP_PHONE_KEYPAD_MODE:
+       g_printerr("Phone keypad mode changed=================\n");
+       break;
     }
 }
 
@@ -1407,3 +1420,4 @@
 
 #define __GTK_SETTINGS_C__
 #include "gtkaliasdef.c"
+#endif
diff -r -u gtk+-2.6.10/gtk/gtktextview.c gtk+-2.6.10.mod/gtk/gtktextview.c
--- gtk+-2.6.10/gtk/gtktextview.c	2005-08-18 10:10:59.000000000 -0400
+++ gtk+-2.6.10.mod/gtk/gtktextview.c	2005-10-18 18:09:36.000000000 -0400
@@ -4632,6 +4632,9 @@
 {
   GtkTextIter insert;
   GtkTextIter newplace;
+  GtkTextIter before;
+  gboolean keypad;
+
 
   gint cursor_x_pos = 0;
 
@@ -4696,6 +4699,7 @@
   if (step == GTK_MOVEMENT_DISPLAY_LINES)
     gtk_text_view_get_virtual_cursor_pos (text_view, &cursor_x_pos, NULL);
 
+  g_object_get(gtk_settings_get_default(), "gtk-phone-keypad-mode", &keypad, NULL);
   switch (step)
     {
     case GTK_MOVEMENT_LOGICAL_POSITIONS:
@@ -4703,8 +4707,22 @@
       break;
 
     case GTK_MOVEMENT_VISUAL_POSITIONS:
+      before = newplace;
       gtk_text_layout_move_iter_visually (text_view->layout,
-                                          &newplace, count);
+                                           &newplace, count);
+       if (keypad)
+       {
+               if (gtk_text_iter_equal(&before,&newplace) )
+               {
+                       GtkTextDirection dir = gtk_widget_get_direction(GTK_WIDGET(text_view));
+                       if ((count > 0 && dir != GTK_TEXT_DIR_RTL) ||
+                       (count < 0 && dir == GTK_TEXT_DIR_RTL))
+                               gtk_text_view_move_focus (text_view,GTK_DIR_TAB_FORWARD);
+                       else
+                               gtk_text_view_move_focus (text_view,GTK_DIR_TAB_BACKWARD);
+               }
+       }
+
       break;
 
     case GTK_MOVEMENT_WORDS:
@@ -4724,14 +4742,24 @@
           gtk_text_layout_move_iter_to_x (text_view->layout, &newplace, cursor_x_pos);
         else
           /* we currently do not have a backward_to_start, use offset */
-          gtk_text_iter_set_offset (&newplace, 0);
+	{
+               if (keypad)
+                       gtk_text_view_move_focus (text_view,GTK_DIR_UP);
+               else
+                       gtk_text_iter_set_line_offset (&newplace, 0);
+       }
       }
       if (count > 0)
       {
         if (gtk_text_view_move_iter_by_lines (text_view, &newplace, count))
           gtk_text_layout_move_iter_to_x (text_view->layout, &newplace, cursor_x_pos);
         else
-          gtk_text_iter_forward_to_end (&newplace);
+	{
+               if (keypad)
+                       gtk_text_view_move_focus (text_view,GTK_DIR_DOWN);
+               else
+                       gtk_text_iter_forward_to_end (&newplace);
+       }
       }
       break;
 
diff -r -u gtk+-2.6.10/gtk/gtktreeview.c gtk+-2.6.10.mod/gtk/gtktreeview.c
--- gtk+-2.6.10/gtk/gtktreeview.c	2005-08-18 10:10:59.000000000 -0400
+++ gtk+-2.6.10.mod/gtk/gtktreeview.c	2005-11-01 18:02:51.000000000 -0500
@@ -114,6 +114,7 @@
   EXPAND_COLLAPSE_CURSOR_ROW,
   SELECT_CURSOR_PARENT,
   START_INTERACTIVE_SEARCH,
+  ROW_RIGHT_END_REACHED,
   LAST_SIGNAL
 };
 
@@ -842,6 +843,15 @@
 		  _gtk_marshal_NONE__NONE,
 		  G_TYPE_NONE, 0);
 
+  tree_view_signals[ROW_RIGHT_END_REACHED] =
+    g_signal_new ("row_right_end_reached",
+		  G_TYPE_FROM_CLASS (o_class),
+		  G_SIGNAL_RUN_LAST,
+		  G_STRUCT_OFFSET (GtkTreeViewClass, row_right_end_reached),
+		  NULL, NULL,
+		  _gtk_marshal_NONE__BOOLEAN,
+		  G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
+
   tree_view_signals[MOVE_CURSOR] =
     g_signal_new ("move_cursor",
 		  G_TYPE_FROM_CLASS (object_class),
@@ -920,6 +930,7 @@
 		  _gtk_marshal_BOOLEAN__NONE,
 		  G_TYPE_BOOLEAN, 0);
 
+
   /* Key bindings */
   gtk_tree_view_add_move_binding (binding_set, GDK_Up, 0,
 				  GTK_MOVEMENT_DISPLAY_LINES, -1);
@@ -4185,7 +4196,6 @@
   GtkTreeView *tree_view = (GtkTreeView *) widget;
   GList *list;
   gboolean rtl;
-
   rtl = (gtk_widget_get_direction (GTK_WIDGET (tree_view)) == GTK_TEXT_DIR_RTL);
 
   if (GTK_TREE_VIEW_FLAG_SET (tree_view, GTK_TREE_VIEW_IN_COLUMN_DRAG))
@@ -8551,6 +8561,7 @@
   GList *list;
   gboolean found_column = FALSE;
   gboolean rtl;
+  gboolean direction;
 
   rtl = (gtk_widget_get_direction (GTK_WIDGET (tree_view)) == GTK_TEXT_DIR_RTL);
 
@@ -8617,6 +8628,9 @@
 				        NULL);
       g_signal_emit (tree_view, tree_view_signals[CURSOR_CHANGED], 0);
     }
+  else   //means focus in the end of a row, TRUE means right end reached, FALSE means left end reached 
+      g_signal_emit (tree_view, tree_view_signals[ROW_RIGHT_END_REACHED], 0, count > 0  ? TRUE : FALSE);
+      //yjyu, why not "g_signal_emit (tree_view, tree_view_signals[ROW_RIGHT_END_REACHED], count > 0 ? TRUE : FALSE);"
   gtk_tree_view_clamp_column_visible (tree_view, tree_view->priv->focus_column);
 }
 
diff -r -u gtk+-2.6.10/gtk/gtktreeview.h gtk+-2.6.10.mod/gtk/gtktreeview.h
--- gtk+-2.6.10/gtk/gtktreeview.h	2005-08-18 10:10:59.000000000 -0400
+++ gtk+-2.6.10.mod/gtk/gtktreeview.h	2005-11-01 12:30:40.000000000 -0500
@@ -85,6 +85,8 @@
 				           GtkTreePath       *path);
   void     (* columns_changed)            (GtkTreeView       *tree_view);
   void     (* cursor_changed)             (GtkTreeView       *tree_view);
+  void (* row_right_end_reached)	  (GtkTreeView       *tree_view,
+					   gboolean           right_end);
 
   /* Key Binding signals */
   gboolean (* move_cursor)                (GtkTreeView       *tree_view,
@@ -103,7 +105,7 @@
   gboolean (* start_interactive_search)   (GtkTreeView       *tree_view);
 
   /* Padding for future expansion */
-  void (*_gtk_reserved0) (void);
+  //void (*_gtk_reserved0) (void);
   void (*_gtk_reserved1) (void);
   void (*_gtk_reserved2) (void);
   void (*_gtk_reserved3) (void);

diff -r -u gtk+-2.6.10/gtk/gtkvscale.c gtk+-2.6.10.mod/gtk/gtkvscale.c
--- gtk+-2.6.10/gtk/gtkvscale.c	2005-08-18 10:10:59.000000000 -0400
+++ gtk+-2.6.10.mod/gtk/gtkvscale.c	2005-10-28 14:46:13.000000000 -0400
@@ -25,10 +25,13 @@
  */
 
 #include <config.h>
+#ifndef GTK_NO_VSCALE
 #include <math.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include "gtkvscale.h"
+#include "gdk/gdkkeysyms.h"
+#include "gtkbindings.h"
 #include "gtkintl.h"
 #include "gtkalias.h"
 
@@ -40,11 +43,13 @@
 static void     gtk_vscale_init             (GtkVScale      *vscale);
 static gboolean gtk_vscale_expose           (GtkWidget      *widget,
                                              GdkEventExpose *event);
+static gint gtk_vscale_key_press_event (GtkWidget *widget, GdkEventKey *event);
 
 static void	gtk_vscale_get_layout_offsets (GtkScale		*scale,
                                                gint		*x,
                                                gint		*y);
 
+
 GType
 gtk_vscale_get_type (void)
 {
@@ -78,7 +83,8 @@
   GtkWidgetClass *widget_class;
   GtkRangeClass *range_class;
   GtkScaleClass *scale_class;
-  
+  GtkBindingSet *binding_set;
+
   widget_class = GTK_WIDGET_CLASS (class);
   range_class = GTK_RANGE_CLASS (class); 
   scale_class = GTK_SCALE_CLASS (class); 
@@ -90,6 +96,25 @@
   scale_class->get_layout_offsets = gtk_vscale_get_layout_offsets;
 
   widget_class->expose_event = gtk_vscale_expose;
+  widget_class->key_press_event = gtk_vscale_key_press_event;
+
+  binding_set = gtk_binding_set_by_class (class);
+
+  gtk_binding_entry_add_signal (binding_set, GDK_Up, 0,
+                                "move_slider", 1,
+                                GTK_TYPE_SCROLL_TYPE, GTK_SCROLL_STEP_UP);
+
+  gtk_binding_entry_add_signal (binding_set, GDK_KP_Up, 0,
+                                "move_slider", 1,
+                                GTK_TYPE_SCROLL_TYPE, GTK_SCROLL_STEP_UP);
+
+  gtk_binding_entry_add_signal (binding_set, GDK_Down, 0,
+                                "move_slider", 1,
+                                GTK_TYPE_SCROLL_TYPE, GTK_SCROLL_STEP_DOWN);
+
+  gtk_binding_entry_add_signal (binding_set, GDK_KP_Down, 0,
+                                "move_slider", 1,
+                                GTK_TYPE_SCROLL_TYPE, GTK_SCROLL_STEP_DOWN);
 }
 
 static void
@@ -199,6 +224,35 @@
 
 }
 
+static gint
+gtk_vscale_key_press_event (GtkWidget *widget, GdkEventKey *event)
+{
+ if (GTK_WIDGET_CLASS (parent_class)->key_press_event &&
+           GTK_WIDGET_CLASS (parent_class)->key_press_event (widget, event))
+   return TRUE;
+
+  switch (event->keyval)
+    {
+    case GDK_Left:
+    case GDK_KP_Left:
+	 if (gtk_widget_get_direction(widget) == GTK_TEXT_DIR_RTL)
+         	gtk_widget_child_focus (gtk_widget_get_toplevel (widget), GTK_DIR_TAB_FORWARD);
+	 else
+         	gtk_widget_child_focus (gtk_widget_get_toplevel (widget), GTK_DIR_TAB_BACKWARD);
+	 break;
+    case GDK_Right:
+    case GDK_KP_Right:
+	 if (gtk_widget_get_direction(widget) == GTK_TEXT_DIR_RTL)
+         	gtk_widget_child_focus (gtk_widget_get_toplevel (widget), GTK_DIR_TAB_BACKWARD);
+	 else
+         	gtk_widget_child_focus (gtk_widget_get_toplevel (widget), GTK_DIR_TAB_FORWARD);
+	 break;
+    default:
+      return FALSE;	
+    }
+  return TRUE;
+}
+
 static void
 gtk_vscale_get_layout_offsets (GtkScale *scale,
                                gint     *x,
@@ -265,3 +319,5 @@
 
 #define __GTK_VSCALE_C__
 #include "gtkaliasdef.c"
+#endif //GTK_NO_VSCALE
+
