Index: gcalctool/display.c
===================================================================
--- gcalctool/display.c	(revision 1867)
+++ gcalctool/display.c	(working copy)
@@ -157,7 +157,7 @@
   
     v->new_input = 1;               /* Value zero is on calculator display */
 
-    exp_del();
+    exp_clear();
 }
 
 
Index: gcalctool/functions.c
===================================================================
--- gcalctool/functions.c	(revision 1867)
+++ gcalctool/functions.c	(working copy)
@@ -273,7 +273,7 @@
 
 
 void
-exp_del()
+exp_clear()
 {
     exp_replace("Ans");
 }
@@ -319,7 +319,8 @@
     char buf[MAXLINE] = "", *display;
     struct exprm_state *e = get_state();
     int i, MP_reg[MP_SIZE];
-    
+
+    /* If cursor is at end of the line then delete the last character preserving accuracy */
     if (cursor < 0) {
         if (exp_has_postfix(e->expression, "Ans")) {
             char *ans = make_number(e->ans, v->base, FALSE);
@@ -351,6 +352,21 @@
 }
 
 
+static int
+exp_delete(int cursor)
+{
+    char buf[MAXLINE] = "", *display;
+    
+    if (cursor >= 0) {
+        display = ui_get_display();
+        SNPRINTF(buf, MAXLINE, "%.*s%s", cursor, display, display + cursor + 1);
+        exp_replace(buf);
+    }
+
+    return cursor;
+}
+
+
 void
 exp_replace(char *text)
 {
@@ -463,7 +479,7 @@
     switch (buttons[function].id) {
         case KEY_CLEAR:
         case KEY_CLEAR_ENTRY:
-            exp_del();
+            exp_clear();
             ui_set_error_state(FALSE);
             MPstr_to_num("0", DEC, e->ans);
             break;
@@ -501,6 +517,10 @@
         case KEY_BACKSPACE:
             cursor = exp_backspace(cursor);
             break;
+        
+        case KEY_DELETE:
+            cursor = exp_delete(cursor);
+            break;
 
         case KEY_CHANGE_SIGN:
             exp_negate();
@@ -908,7 +928,7 @@
 
 /* Remove the last numeric character typed. */
 void
-do_delete()
+do_backspace()
 {
     size_t len;
 
@@ -942,6 +962,13 @@
 }
 
 
+void
+do_delete()
+{
+    /* Not required in ltr mode */
+}
+
+
 /* Exchange display with memory register. */
 void
 do_exchange(int index)
Index: gcalctool/functions.h
===================================================================
--- gcalctool/functions.h	(revision 1867)
+++ gcalctool/functions.h	(working copy)
@@ -33,7 +33,7 @@
 void make_exp(char *number, int t[MP_SIZE]);
 int exp_insert(char *text, int);
 void exp_replace(char *text);
-void exp_del();
+void exp_clear();
 
 struct exprm_state *get_state(void);
 
@@ -48,6 +48,7 @@
 void do_expression();
 void do_clear();
 void do_clear_entry();
+void do_backspace();
 void do_delete();
 void do_numtype(enum num_type);
 void do_expno();
Index: gcalctool/gtk.c
===================================================================
--- gcalctool/gtk.c	(revision 1867)
+++ gcalctool/gtk.c	(working copy)
@@ -143,11 +143,11 @@
     { GDK_f, 0 }},
 
     {KEY_CLEAR,              "clear_simple",
-    { 0, 0 },
+    { GDK_SHIFT_MASK, 0 },
     { GDK_Delete, 0 }},
     
     {KEY_CLEAR,              "clear_advanced",
-    { 0, 0 },
+    { GDK_SHIFT_MASK, 0 },
     { GDK_Delete, 0 }},
 
     {KEY_SHIFT,              "shift_left",
@@ -197,7 +197,7 @@
     {KEY_BACKSPACE,          "backspace_advanced",
     { 0, 0 },
     { GDK_BackSpace, 0 }},
-
+    
     {KEY_NUMERIC_POINT,      "numeric_point",
     { 0,          0,              0,             0 },
     { GDK_period, GDK_KP_Decimal, GDK_KP_Delete, GDK_KP_Separator, 0 }},
@@ -488,7 +488,7 @@
         case EXPRS:
             e = get_state();
             MPstr_to_num("0", DEC, e->ans);
-            exp_del();
+            exp_clear();
             show_display(e->ans);
             break;
         
@@ -2016,13 +2016,14 @@
     int i, j, state;
     GtkWidget *button;
     
+    /* Only look at the modifiers we use */
+    state = event->state & (GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_MOD1_MASK);
+    
     if (check_for_localized_numeric_point(event->keyval) == TRUE) {
         event->state = 0;
         event->keyval = GDK_KP_Decimal;
     }
     
-    state = event->state & (GDK_CONTROL_MASK | GDK_MOD1_MASK);
-
     /* Accuracy shortcuts */
     if (state == GDK_CONTROL_MASK && v->modetype == SCIENTIFIC) {
         switch (event->keyval) {
@@ -2069,6 +2070,12 @@
             return (TRUE);
         }
     }
+    
+    /* Delete in display */
+    if (event->keyval == GDK_Delete && state == 0) {
+        do_button(KEY_DELETE, 0);
+        return (TRUE);
+    }
 
     for (i = 0; i < NBUTTONS; i++) {
         button = X->buttons[i];
@@ -2079,14 +2086,12 @@
             continue;
         }
 
-        j = 0;
-        while (button_widgets[i].accelerator_keys[j] != 0) {
+        for (j = 0; button_widgets[i].accelerator_keys[j] != 0; j++) {
             if (button_widgets[i].accelerator_keys[j] == event->keyval &&
-                (button_widgets[i].accelerator_mods[j] & ~GDK_SHIFT_MASK) == state) {
+                button_widgets[i].accelerator_mods[j] == state) {
                 button_cb(button, NULL);
                 return (TRUE);
             }
-            j++;
         }
     }
 
@@ -2657,7 +2662,7 @@
     for (i = 0; i < NBUTTONS; i++) {
         SNPRINTF(name, MAXLINE, "calc_%s_button", 
                  button_widgets[i].widget_name);
-        X->buttons[i] = GET_WIDGET(name);
+        X->buttons[i] = GET_WIDGET(name);            
         assert(X->buttons[i] != NULL);
         
         gtk_size_group_add_widget(size_group, X->buttons[i]);
Index: gcalctool/calctool.c
===================================================================
--- gcalctool/calctool.c	(revision 1867)
+++ gcalctool/calctool.c	(working copy)
@@ -207,6 +207,12 @@
 {
     KEY_BACKSPACE,
     NULL,
+    do_backspace,
+    0
+},
+{
+    KEY_DELETE,
+    NULL,
     do_delete,
     0
 },
@@ -707,7 +713,7 @@
         mpcim(&n, v->MPmvals[i]);
     }
     
-    exp_del();
+    exp_clear();
 }
 
 
Index: gcalctool/calctool.h
===================================================================
--- gcalctool/calctool.h	(revision 1867)
+++ gcalctool/calctool.h	(working copy)
@@ -83,6 +83,7 @@
     KEY_ADD, KEY_SUBTRACT,
     KEY_MULTIPLY, KEY_DIVIDE,
     KEY_BACKSPACE,
+    KEY_DELETE,        
     KEY_CHANGE_SIGN,
     KEY_INTEGER,
     KEY_FRACTION,
