Index: gcalctool/calctool.c
===================================================================
--- gcalctool/calctool.c	(revision 1761)
+++ gcalctool/calctool.c	(working copy)
@@ -24,7 +24,6 @@
 #include <stdlib.h>
 #include <sys/types.h>
 #include "calctool.h"
-#include <gdk/gdkkeysyms.h>
 
 #include "functions.h"
 
@@ -66,11 +65,6 @@
 char *Rsstr[MAXSYNTAX]    = { "ARITHMETIC", "ARITHMETIC_PRECEDENCE" };
 char *Rcstr[MAXBITCALC]   = { "NO_BITCALCULATING_MODE", "BITCALCULATING_MODE" };
 
-
-/* Valid keys when an error condition has occured. */
-/*                           Clr */
-int validkeys[MAXVKEYS]  = { GDK_Delete };
-
 Vars v;            /* Calctool variables and options. */
 
 /*  This table shows the keyboard values that are currently being used:
@@ -85,583 +79,439 @@
  *-----------+-----------------------------------------------------
  */
 
+// FIXME: Sort this list
 struct button buttons[NKEYS] = {
 
-/* symname
-   mods
-   value
-   func_char
+/* id,
+   symname
    func
    flags
  */
 
-// FIXME: Move accelerators into gtk.c
 {
+    KEY_0,
     N_("0"),
-    { 0,     GDK_SHIFT_MASK, 0,        0,             0 },
-    { GDK_0, GDK_0,          GDK_KP_0, GDK_KP_Insert, 0 },
-    '0',
     do_number,
-    number | bin_set | oct_set
+    number
 },
 {
+    KEY_1,
     N_("1"),
-    { 0,     GDK_SHIFT_MASK, 0,        0,          0,       0 },
-    { GDK_1, GDK_1,          GDK_KP_1, GDK_KP_End, GDK_R13, 0 },
-    '1',
     do_number,
-    number | bin_set | oct_set
+    number
 },
 {
+    KEY_2,
     N_("2"),
-    { 0,     GDK_SHIFT_MASK, 0,        0,           0 }, 
-    { GDK_2, GDK_2,          GDK_KP_2, GDK_KP_Down, 0 },
-    '2',
     do_number,
-    number | oct_set
+    number
 },    
 {     
+    KEY_3,
     N_("3"),
-    { 0,     GDK_SHIFT_MASK, 0,        0,                0,       0 },
-    { GDK_3, GDK_3,          GDK_KP_3, GDK_KP_Page_Down, GDK_R15, 0 },
-    '3',
     do_number,
-    number | oct_set
+    number
 },
 {
+    KEY_4,
     N_("4"),
-    { 0,     GDK_SHIFT_MASK, 0,        0,           0 },
-    { GDK_4, GDK_4,          GDK_KP_4, GDK_KP_Left, 0 },
-    '4',
     do_number,
-    number | oct_set
+    number
 },
 {
+    KEY_5,
     N_("5"),
-    { 0,     GDK_SHIFT_MASK, 0,        0,            0,       0 },
-    { GDK_5, GDK_5,          GDK_KP_5, GDK_KP_Begin, GDK_R11, 0 },
-    '5',
     do_number,
-    number | oct_set
+    number
 },
 {
+    KEY_6,
     N_("6"),
-    { 0,     GDK_SHIFT_MASK, 0,        0,            0 },
-    { GDK_6, GDK_6,          GDK_KP_6, GDK_KP_Right, 0 },
-    '6',
     do_number,
-    number | oct_set
+    number
 },
 {
+    KEY_7,
     N_("7"),
-    { 0,     GDK_SHIFT_MASK, 0,        0,           0,      0 },
-    { GDK_7, GDK_7,          GDK_KP_7, GDK_KP_Home, GDK_R7, 0 },
-    '7',
     do_number,
-    number | oct_set
+    number
 },
 {
+    KEY_8,
     N_("8"),
-    { 0,     GDK_SHIFT_MASK, 0,        0,         0 },
-    { GDK_8, GDK_8,          GDK_KP_8, GDK_KP_Up, 0 },
-    '8',
     do_number,
     number
 },
 {
+    KEY_9,
     N_("9"),
-    { 0,     GDK_SHIFT_MASK, 0,        0,              0,      0 },
-    { GDK_9, GDK_9,          GDK_KP_9, GDK_KP_Page_Up, GDK_R9, 0 },
-    '9',
     do_number,
     number
 },
 {
+    KEY_A,
     N_("A"),
-    { 0,     0 },
-    { GDK_a, 0 },
-    'a',
     do_number,
-    number | hex
+    number
 },
 {
+    KEY_B,
     N_("B"),
-    { 0,     0 },
-    { GDK_b, 0 },
-    'b',
     do_number,
-    number | hex
+    number
 },    
 {     
+    KEY_C,
     N_("C"),
-    { 0,     0 },
-    { GDK_c, 0 },
-    'c',
     do_number,
-    number | hex
+    number
 },
 {
+    KEY_D,
     N_("D"),
-    { 0,     0 },
-    { GDK_d, 0 },
-    'd',
     do_number,
-    number | hex
+    number
 },
 {
+    KEY_E,
     N_("E"),
-    { 0,     0 },
-    { GDK_e, 0 },
-    'e',
     do_number,
-    number | hex
+    number
 },
 {
+    KEY_F,
     N_("F"),
-    { 0,     0 },
-    { GDK_f, 0 },
-    'f',
     do_number,
-    number | hex
+    number
 },
 {    
+    KEY_NUMERIC_POINT,
     N_("."),
-    { 0,          0,              0,             0 },
-    { GDK_period, GDK_KP_Decimal, GDK_KP_Delete, GDK_KP_Separator, 0 },
-    '.',
     do_point,
     number | dpoint
 },
 {
-    N_("="),
-    { 0,         0,            0,          GDK_SHIFT_MASK, 0 },
-    { GDK_equal, GDK_KP_Enter, GDK_Return, GDK_equal,      0 },
-    '=',
+    KEY_CALCULATE,
+    NULL,
     do_calc,
     enter
 },
 {
-    N_("Clr"),
-    { 0, 0 },
-    { GDK_Delete, 0 },
-    '\177',
+    KEY_CLEAR,
+    NULL,
     do_clear,
     clear
 },
 {
-    N_("Clear entry"),
-    { GDK_CONTROL_MASK, 0,          0 },
-    { GDK_BackSpace,    GDK_Escape, 0 },
-    '\013',
+    KEY_CLEAR_ENTRY,
+    NULL,
     do_clear_entry,
     clear
 },
 {
-    N_("("),
-    { GDK_SHIFT_MASK, 0 },
-    { GDK_parenleft, 0 },
-    '(',
+    KEY_START_BLOCK,
+    "(", /* Do not translate this as the equation solver expects this character always */
     do_paren,
     parenthesis
 },
 {
-    N_(")"),
-    { GDK_SHIFT_MASK, 0 },
-    { GDK_parenright, 0 },
-    ')',
+    KEY_END_BLOCK,
+    ")", /* Do not translate this as the equation solver expects this character always */
     do_paren,
     parenthesis
 },
 {
+    KEY_ADD,
     N_("+"),
-    { GDK_SHIFT_MASK, 0,        0,          0 },
-    { GDK_plus,       GDK_plus, GDK_KP_Add, 0 },
-    '+',
     do_calc,
     binop
 },
 {
+    KEY_SUBTRACT,
     N_("-"),
-    { 0,         0,               0,      0 },
-    { GDK_minus, GDK_KP_Subtract, GDK_R4, 0 },
-    '-',
     do_calc,
     unop | binop
 },
 {
+    KEY_MULTIPLY,
     N_("*"),
-    { GDK_SHIFT_MASK, 0,               0,     0,      0 },
-    { GDK_asterisk,   GDK_KP_Multiply, GDK_x, GDK_R6, 0 },
-    '*',
     do_calc,
     binop
 },
 {
+    KEY_DIVIDE,
     N_("/"),
-    { 0,         GDK_SHIFT_MASK, 0,             0,      GDK_SHIFT_MASK, 0 },
-    { GDK_slash, GDK_slash,      GDK_KP_Divide, GDK_R5, GDK_slash,      0 },
-    '/',
     do_calc,
     binop
 },
 {
+    KEY_BACKSPACE,
     NULL,
-    { 0, 0 },
-    { GDK_BackSpace, 0 },
-    '\010',
     do_delete,
     bsp
 },
 {
-    N_("Chs"),
-    { GDK_SHIFT_MASK, 0 },
-    { GDK_C,          0 },
-    'C',
+    KEY_CHANGE_SIGN,
+    NULL,
     do_immed, 
     neg
 },
 {
+    KEY_INTEGER,
     N_("Int"),
-    { 0, 0 },
-    { GDK_i, 0 },
-    'i',
     do_portion,
     func
 },
 {
+    KEY_FRACTION,
     N_("Frac"),
-    { GDK_SHIFT_MASK, 0 },
-    { GDK_colon, 0 },
-    ':',
     do_portion,
     func  
 },
 {
+    KEY_PERCENTAGE,
     N_("%"),
-    { GDK_SHIFT_MASK, 0 },
-    { GDK_percent, 0 },
-    '%',
     do_percent,  
     immediate
 },
 {
+    KEY_SQUARE,
     N_("^2"),
-    { GDK_SHIFT_MASK, 0 },
-    { GDK_at, 0 },
-    '@',
     do_immed,  
     immediate | postfixop
 },
 {
+    KEY_SQUARE_ROOT,
     N_("Sqrt"),
-    { 0, 0 },   
-    { GDK_s, 0 },
-    's',
     do_immed, 
     func
 },
 {
-    N_("Recip"),
-    { 0, 0 },
-    { GDK_r, 0 },
-    'r',
+    KEY_RECIPROCAL,
+    NULL,
     do_immed, 
     inv
 },
 {
+    KEY_E_POW_X,
     N_("e^"),
-    { GDK_SHIFT_MASK, 0 },
-    { GDK_braceleft, 0 },
-    '{',
     do_immed, 
     immediate | prefixop
 },
 {
+    KEY_10_POW_X,
     N_("10^"),
-    { GDK_SHIFT_MASK, 0 },
-    { GDK_braceright, 0 },
-    '}',
     do_immed, 
     prefixop
 },       
 {
+    KEY_X_POW_Y,
     N_("^"),
-    { GDK_SHIFT_MASK, GDK_SHIFT_MASK,  0 },
-    { GDK_caret,      GDK_asciicircum, 0 },
-    '^',
     do_calc,
     binop | postfixop
 },
 {
+    KEY_FACTORIAL,
     N_("!"),
-    { GDK_SHIFT_MASK, 0 },
-    { GDK_exclam, 0 },
-    '!',
     do_immed, 
     immediate | postfixop
 },
 {
+    KEY_RANDOM,
     N_("Rand"),
-    { GDK_SHIFT_MASK, 0 },
-    { GDK_question, 0 },
-    '?',
     do_immed, 
     none
 },
 {
+    KEY_SINE,
     N_("Sin"),
-    { GDK_SHIFT_MASK, 0 },
-    { GDK_K, 0 },
-    'K',
     do_trig,
     func
 },
 {
+    KEY_COSINE,
     N_("Cos"),
-    { GDK_SHIFT_MASK, 0 },
-    { GDK_J, 0 },
-    'J',
     do_trig,
     func
 },
-{        
+{
+    KEY_TANGENT,
     N_("Tan"),
-    { GDK_SHIFT_MASK, 0 },
-    { GDK_L, 0 },
-    'L',
     do_trig,
     func
 },
-{      
+{
+    KEY_NATURAL_LOGARITHM,
     N_("Ln"),
-    { GDK_SHIFT_MASK, 0 },
-    { GDK_N, 0 },
-    'N',
     do_immed, 
     func
 },
-{ 
+{
+    KEY_LOGARITHM,
     N_("Log"),
-    { GDK_SHIFT_MASK, 0 },
-    { GDK_G, 0 },
-    'G',
     do_immed, 
     func
 },
 {
+    KEY_ABSOLUTE_VALUE,
     /* Note to translators: Abs is short for Absolute. */
     N_("Abs"),
-    { 0, 0 },
-    { GDK_u, 0 },
-    'u',
     do_portion,
     func
 },
 {
+    KEY_MASK_16,
     N_("u16"),
-    { 0, 0 },        
-    { GDK_bracketright, 0 },
-    ']',
     do_immed,  
     func
 },            
 {
+    KEY_MASK_32,
     N_("u32"),
-    { 0, 0 },
-    { GDK_bracketleft, 0 },
-    '[',
     do_immed,  
     func
 },
 {
+    KEY_MODULUS_DIVIDE,
     N_(" Mod "),
-    { GDK_SHIFT_MASK, 0 },
-    { GDK_M,          0 },
-    'M',
     do_calc,
     binop
 },
 {
+    KEY_EXPONENTIAL,
     N_("e"),
-    { GDK_SHIFT_MASK, 0 },
-    { GDK_E,          0 },
-    'E',
     do_expno,
     expnum
 },
 {
+    KEY_NOT,
     N_("~"),
-    { GDK_SHIFT_MASK, 0 },
-    { GDK_asciitilde, 0 },
-    '~',
     do_immed, 
     unop | immediate
 },
 {
+    KEY_OR,
     N_(" OR "),
-    { GDK_SHIFT_MASK, 0 },
-    { GDK_bar, 0 },
-    '|',
     do_calc,
     binop
 },
 {
+    KEY_AND,
     N_(" AND "),
-    { GDK_SHIFT_MASK, 0 },
-    { GDK_ampersand, 0 },
-    '&',
     do_calc,
     binop
 },       
 {
+    KEY_XOR,
     N_(" XOR "),
-    { 0, 0 },   
-    { GDK_x, 0 },
-    'x',
     do_calc,
     binop
 },
 {
+    KEY_XNOR,
     N_(" XNOR "),
-    { 0, 0 },
-    { GDK_n, 0 },
-    'n',
     do_calc,
     binop
 },
 {
+    KEY_FINC_CTRM,
     N_("Ctrm"),
-    { 0, 0 },
-    { GDK_m, 0 },
-    'm',
     do_business,
     none
 },
 {
+    KEY_FINC_DDB,
     N_("Ddb"),
-    { GDK_SHIFT_MASK, 0 },
-    { GDK_D,          0 },
-    'D',
     do_business,
     none
 },
 {
+    KEY_FINC_FV,
     N_("Fv"),
-    { 0, 0 },
-    { GDK_v, 0 },
-    'v',
     do_business,
     none
 },
 {
+    KEY_FINC_PMT,
     N_("Pmt"),
-    { GDK_SHIFT_MASK, 0 },
-    { GDK_P, 0 },
-    'P',
     do_business,
     none
 },
 {
+    KEY_FINC_PV,
     N_("Pv"),
-    { 0, 0 },
-    { GDK_p, 0 },
-    'p',
     do_business,
     none
 },
 {
+    KEY_FINC_RATE,
     N_("Rate"),
-    { GDK_SHIFT_MASK, 0 },
-    { GDK_T, 0 },
-    'T',
     do_business,
     none
 },
 {
+    KEY_FINC_SLN,
     N_("Sln"),
-    { 0, 0 },
-    { GDK_l, 0 },
-    'l',
     do_business,
     none
 },
-{ 
+{
+    KEY_FINC_SYD,
     N_("Syd"),
-    { 0, 0 },
-    { GDK_Y, 0 },
-    'Y',
     do_business,
     none
 },
-{ 
+{
+    KEY_FINC_TERM,
     N_("Term"),
-    { 0, 0 },
-    { GDK_T, 0 },
-    'T',
     do_business,
     none
 },
 {
-    N_("<"),
-    { GDK_SHIFT_MASK, 0 },
-    { GDK_less, 0 },
-    '<',
+    KEY_LEFT_SHIFT,
+    NULL,
     do_pending,
     pending
 },
 {
-    N_(">"),
-    { GDK_SHIFT_MASK, 0 },
-    { GDK_greater, 0 },
-    '>',
+    KEY_RIGHT_SHIFT,
+    NULL,
     do_pending,
     pending
 },
 {
-    N_("Sto"),
-    { GDK_SHIFT_MASK, 0 },
-    { GDK_S, 0 },
-    'S',
+    KEY_STORE,
+    NULL,
     do_pending,
     pending
 },
 {
-    N_("Rcl"),
-    { GDK_SHIFT_MASK, 0 },
-    { GDK_R, 0 },
-    'R',
+    KEY_RECALL,
+    NULL,
     do_pending,
     pending
 },
 {
-    N_("Exch"),
-    { GDK_SHIFT_MASK, 0 },
-    { GDK_X, 0 },
-    'X',
+    KEY_EXCHANGE,
+    NULL,
     do_pending,
     pending
 },
 {
-    N_("Acc"),
-    { GDK_SHIFT_MASK, 0 },
-    { GDK_A,          0 },
-    'A',
+    KEY_ACCURACY_MENU,
+    NULL,
     do_pending,
     pending
 },
 {
-    N_("Con"),
-    { GDK_SHIFT_MASK, 0,              0 },
-    { GDK_numbersign, GDK_numbersign, 0 },   
-    '#',
+    KEY_CONSTANTS_MENU,
+    NULL,
     do_pending,
     pending
 },
 {
-    N_("Fun"),
-    { GDK_SHIFT_MASK, 0 },
-    { GDK_F,          0 },
-    'F',
+    KEY_FUNCTIONS_MENU,
+    NULL,
     do_pending,
     pending
 },
@@ -709,12 +559,12 @@
     read_cfdefs();             /* Read constant/function definitions. */
     make_frames();             /* Create gcalctool window frames. */
 
-    v->current    = copy_button_info(button_for_value(buttons[KEY_CALCULATE].value[0]));
+    v->current    = copy_button_info(&buttons[KEY_CALCULATE]);
     v->shelf      = NULL;      /* No selection for shelf initially. */
     v->noparens   = 0;         /* No unmatched brackets initially. */
     v->opsptr     = 0;         /* Nothing on the parentheses op stack. */
     v->numsptr    = 0;         /* Nothing on the parenthese numeric stack. */
-    v->pending    = 0;         /* No initial pending command. */
+    v->pending    = -1;        /* No initial pending command. */
     v->hyperbolic = 0;         /* Normal trig functions initially. */
     v->inverse    = 0;         /* No inverse functions initially. */
     v->down       = 0;         /* No mouse presses initially. */
Index: gcalctool/graphics.c
===================================================================
--- gcalctool/graphics.c	(revision 1761)
+++ gcalctool/graphics.c	(working copy)
@@ -36,16 +36,17 @@
     if (item != -1) {    
         struct exprm_state *e;
 
-	save_pending_values(n);
+	v->pending = n->id;
 	if (v->current != NULL) {
 	    free(v->current);
 	}
 
 	e = get_state();
-	memcpy(&(e->button), button_for_value(item), sizeof(struct button));
+	memcpy(&(e->button), n, sizeof(struct button));
+	e->value = v->current_value;
 	new_state();
 	
-	v->current = copy_button_info(button_for_value(item));
+	v->current = copy_button_info(n);
 	v->ismenu = 1;       /* To prevent grey buttons being redrawn. */
 	do_pending();
 	v->ismenu = 0;
Index: gcalctool/ce_parser.c
===================================================================
--- gcalctool/ce_parser.c	(revision 1761)
+++ gcalctool/ce_parser.c	(working copy)
@@ -34,6 +34,7 @@
     if (!(expression && result)) {
         return(-EINVAL);
     }
+    printf("ce_parse(\"%s\", %d)\n", expression, flags);
 
     memset(&parser_state, 0, sizeof(struct parser_state));
 
@@ -44,9 +45,8 @@
         ret = ceparse();
         free(parser_state.buff);
     }
-
+    printf("%d,%d\n", parser_state.error, ret);
     ret = (parser_state.error) ? parser_state.error : ret;
-
     if (ret) {
         return(ret);
     } else {
Index: gcalctool/display.c
===================================================================
--- gcalctool/display.c	(revision 1761)
+++ gcalctool/display.c	(working copy)
@@ -23,7 +23,6 @@
 #include <string.h>
 #include <assert.h>
 #include "calctool.h"
-#include <gdk/gdkkeysyms.h>
 #include "extern.h"
 #include "mpmath.h"
 #include "functions.h"
@@ -111,6 +110,8 @@
 clear_display(int initialise)
 {
     int i;
+    
+    printf("clear_display\n");
 
     v->pointed = 0;
     v->toclear = 1;
@@ -157,9 +158,9 @@
     struct exprm_state *e;
  
     v->error         = 0;           /* Currently no display error. */
-    v->cur_op        = '?';         /* No arithmetic operator defined yet. */
-    v->old_cal_value = '?';
-    v->pending       = 0;
+    v->cur_op        = -1;         /* No arithmetic operator defined yet. */
+    v->old_cal_value = -1;
+    v->pending       = -1;
     i = 0;
     mpcim(&i, v->MPresult);         /* No previous result yet. */
     mpcim(&i, v->MPdisp_val);         
@@ -234,6 +235,7 @@
     }    
     *optr++ = '\0';
     if (toclear == TRUE) {
+	printf("make_fixed -> toclear\n");
         v->toclear = 1;
     }
     v->pointed = 0;
@@ -259,6 +261,8 @@
 make_number(int *MPnumber, int base, BOOLEAN ignoreError)
 {
     double number, val;
+    
+    printf("make_number\n");
 
 /*  NOTE: make_number can currently set v->error when converting to a double.
  *        This is to provide the same look&feel as V3 even though gcalctool
@@ -296,6 +300,8 @@
     int ddig;                   /* Number of digits in exponent. */
     int eng = 0;                /* Set if this is an engineering number. */
     int exp = 0;                /* Exponent */
+    
+    printf("make_eng_sci\n");
 
     if (v->dtype == ENG) {
         eng = 1;
@@ -468,9 +474,10 @@
 /* Append the latest parenthesis char to the display item. */
 
 void
-paren_disp(int c)
+paren_disp(int key)
 {
     int i, n;
+    char *text;
 
 /*  If the character is a Delete, clear the whole line, and exit parenthesis
  *  processing.
@@ -483,14 +490,19 @@
  */
 
     n = strlen(v->display);
-    if (c == -1 || c == 127) {         /* Is it a Delete character? */
-        v->noparens = v->pending = v->opsptr = v->numsptr = 0;
-        v->cur_op = '?';
+    text = buttons[key].symname;
+    switch (key)
+    {
+    case -1:
+    case KEY_CLEAR:
+        v->noparens = v->opsptr = v->numsptr = 0;
+	v->pending = -1;
+        v->cur_op = -1;
         i = 0;
         mpcim(&i, v->MPdisp_val);
         show_display(v->MPdisp_val);
         return;
-    } else if (c == 8) {  /* Is is a Back Space character? */
+    case KEY_BACKSPACE:
         if (!n) {
             return;
         }
@@ -500,38 +512,38 @@
         } else if (v->display[n-1] == '(') {
             v->noparens--;
             if (!v->noparens) {
-                v->pending = v->opsptr = v->numsptr = 0;
-                v->cur_op = '?';
+                v->opsptr = v->numsptr = 0;
+		v->pending = -1;
+                v->cur_op = -1;
                 show_display(v->MPdisp_val);
                 return;
             }
         } else if (v->display[n-1] == ')') v->noparens++;
         v->display[n-1] = '\0';
+	break;
 
-    } else if (c == '(') {
+    case KEY_START_BLOCK:
 
 /* If this is the first left parenthesis being displayed and there is no
  * current arithmetic operand, then the current display is initially cleared
  * to avoid the confusion of showing something like "0(".
  */
 
-        if (v->noparens == 1 && v->cur_op == '?') {
-            n = 0;
-            v->display[n] = '\0';
+        if (v->noparens == 1 && v->cur_op == -1) {
+	    n = 0;
+            v->display[0] = '\0';
         }
+	text = "(";
+	break;
 
-        if (n < MAXLINE-1) {
-            v->display[n]   = c;
-            v->display[n+1] = '\0';
-        }
-
-    } else {                           /* It must be an ordinary character. */
-        if (n < MAXLINE-1) {
-            v->display[n]   = c;
-            v->display[n+1] = '\0';
-        }
+    case KEY_END_BLOCK:
+	text = ")";
+	break;
     }
 
+    if (text)
+	SNPRINTF(v->display+n, MAXLINE-n, "%s", text);
+
     n = (n < MAX_DIGITS) ? 0 : n - MAX_DIGITS;
     v->show_paren = 1;       /* Hack to get set_display to really display it. */
     set_display(&v->display[n], FALSE);
@@ -542,40 +554,25 @@
 void
 process_item(struct button *button)
 {
-    int i, isvalid;
+    int isvalid;
+    printf("process_item\n");
 
     if (v->current != NULL) {
         free(v->current);
     }
     v->current = copy_button_info(button);
 
-/* Reassign "extra" values. */
-
-    if (v->current->value[0] == GDK_Return) {
-        v->current->value[0] = '=';
-    }
-    if (v->current->value[0] == 'Q') {
-        v->current->value[0] = 'q';
-    }
-
     if (v->error) {
-        isvalid = 0;                    /* Must press a valid key first. */
-        for (i = 0; i < MAXVKEYS; i++) {
-            if (v->current->value[0] == validkeys[i]) {
-                isvalid = 1;
-            }
-        }
-        if (v->pending == '?') {
-            isvalid = 1;
-        }
-        if (!isvalid) {
+        /* Must press a valid key first. */
+	if (v->current->id != KEY_CLEAR) {
             return;
         }
         set_error_state(FALSE);
     }
 
-    if (v->pending) {
-        (*v->pending_but->func)();
+    if (v->pending >= 0) {
+	printf("process_item, pending=1\n");
+	buttons[v->pending].func();
         return;
     }
 
Index: gcalctool/calctool.h
===================================================================
--- gcalctool/calctool.h	(revision 1761)
+++ gcalctool/calctool.h	(working copy)
@@ -167,7 +167,6 @@
 #define EQUAL(a, b)    (strlen(a)==strlen(b)) & !strcmp(a, b) 
 
 #define INC            { argc--; argv++; }
-#define IS_KEY(v, n)   (v == n)
 
 #ifndef LINT_CAST
 #ifdef  lint
@@ -197,14 +196,9 @@
 #define MAXREGS        10         /* Maximum number of memory registers. */
 #define MAXSTACK       256        /* Parenthese stack size. */
 #define MAXTRIGMODES   3          /* Maximum number of trig. modes. */
-#define MAXVKEYS       1          /* Number of valid keys after an error. */
 #define MAXSYNTAX      2          /* Number of syntaxes in calculator */
 #define MAXBITCALC     2          /* Choices for bitcalculating */
 
-#define MCOLS          8          /* Number of columns of "special" keys. */
-#define MROWS          2          /* Number of rows of "special" keys. */
-#define MODEKEYS       MCOLS * MROWS
-
 #ifndef MIN
 #define MIN(x,y)       ((x) < (y) ? (x) : (y))
 #endif /*MIN*/
@@ -252,9 +246,6 @@
     prefixop     = (1 << 15),  /* Unary prefix operation */
     dpoint       = (1 << 16),  /* Decimal point */
     pending      = (1 << 17),  /* Is a pending button */
-    hex          = (1 << 18),  /* Is a hex button A..F */
-    oct_set      = (1 << 19),  /* Is a oct button 0..7 */
-    bin_set      = (1 << 20)   /* Is a bin button 0..1 */
 };
 
 enum shiftd {
@@ -268,16 +259,15 @@
 };
 
 struct button {
+    int id;
     char *symname;           /* Expression function name */
-    guint mods[MAXEXTRAS];   /* Keyboard modifiers (Shift, Ctrl, ...). */
-    guint value[MAXEXTRAS];  /* Button keyboard equivalents. */
-    char func_char;          /* Unique function string character. */
     void (*func)();          /* Function to obey on button press. */
     enum button_flags flags; /* Misc flags */
 };
 
 struct exprm_state {       /* Expression mode state */
     struct button button;  /* Current button/character pressed. */
+    int value;
     int ans[MP_SIZE];      /* Previously calculated answer */
     char *expression;      /* Expression entered by user */
 };
@@ -300,7 +290,6 @@
 struct calcVars {                      /* Calctool variables and options. */
     struct exprm_state_history h;      /* History of expression mode states */
 
-    struct button *pending_but;        /* Button info. for pending op. */
     struct button *current;            /* Current button/character pressed. */
   
     char *appname;                     /* Application name for resources. */
@@ -345,7 +334,6 @@
 
     int accuracy;      /* Number of digits precision (Max 9). */
     int beep;          /* Indicates whether there is a beep sound on error. */
-    int cur_ch;        /* Current character if keyboard event. */
     int cur_op;        /* Current arithmetic operation. */
     int doing_mi;      /* Set if adjusting the "show zeroes" menu item. */
     int down;          /* Indicates is a mouse button is down. */
@@ -366,7 +354,6 @@
     int opsptr;        /* Pointer into the parentheses operand stack. */
     int opstack[MAXSTACK];  /* Stack containing parentheses input. */
     int pending;            /* Set for command depending on multiple presses. */
-    int pending_op;    /* Arithmetic operation for pending command. */
     int pointed;       /* Whether a decimal point has been given. */
     int rstate;        /* Indicates if memory register frame is displayed. */
     int show_paren;    /* Set if we wish to show DISPLAYITEM during parens. */
@@ -376,6 +363,8 @@
     int toclear;       /* Indicates if display should be cleared. */
     int warn_change_mode;    /* Should we warn user when changing modes? */
     int bitcalculating_mode;  /* 0 = no, else yes */
+    
+    int current_value; // FIXME
 };
 
 typedef struct calcVars *Vars;
@@ -390,7 +379,6 @@
 #define dmax(a, b)  (double) max(a, b)
 #define dmin(a, b)  (double) min(a, b)
 
-struct button *button_for_fc(char);
 struct button *button_for_value(int);
 struct button *copy_button_info(struct button *);
 
@@ -417,7 +405,6 @@
 int do_tfunc(int s[MP_SIZE], int t[MP_SIZE], enum trig_func tfunc);
 int get_int_resource(enum res_type, int *);
 int get_menu_entry(enum menu_type, int);
-int key_equal(struct button *, struct button);
 int main(int, char **);
 
 void beep();
@@ -478,7 +465,6 @@
 void read_resources();
 void read_str(char **, char *);
 void refresh_display();
-void save_pending_values(struct button *);
 void save_resources();
 void set_accuracy_menu_item(int);
 void set_accuracy_tooltip(int);
Index: gcalctool/functions.c
===================================================================
--- gcalctool/functions.c	(revision 1761)
+++ gcalctool/functions.c	(working copy)
@@ -213,8 +213,8 @@
     int i;
 
     for (i = 0; i <= 9; i++) {
-        if (v->current->value[0] == get_menu_entry(M_ACC, i)) {
-            v->accuracy = char_val(v->current->value[0]);
+        if (v->current_value == get_menu_entry(M_ACC, i)) {
+            v->accuracy = char_val(v->current_value);
             SPRINTF(intval, "%d", v->accuracy);
             put_resource(R_ACCURACY, intval);
             set_accuracy_menu_item(v->accuracy);
@@ -229,23 +229,23 @@
 void
 do_business()     /* Perform special business mode calculations. */
 {
-    if (key_equal(v->current, buttons[KEY_FINC_CTRM])) {
+    if (v->current->id == KEY_FINC_CTRM) {
         calc_ctrm(v->MPdisp_val);
-    } else if (key_equal(v->current, buttons[KEY_FINC_DDB])) {
+    } else if (v->current->id == KEY_FINC_DDB) {
         calc_ddb(v->MPdisp_val);
-    } else if (key_equal(v->current, buttons[KEY_FINC_FV])) {
+    } else if (v->current->id == KEY_FINC_FV) {
         calc_fv(v->MPdisp_val);
-    } else if (key_equal(v->current, buttons[KEY_FINC_PMT])) {
+    } else if (v->current->id == KEY_FINC_PMT) {
         calc_pmt(v->MPdisp_val);
-    } else if (key_equal(v->current, buttons[KEY_FINC_PV])) {
+    } else if (v->current->id == KEY_FINC_PV) {
         calc_pv(v->MPdisp_val);
-    } else if (key_equal(v->current, buttons[KEY_FINC_RATE])) {
+    } else if (v->current->id == KEY_FINC_RATE) {
         calc_rate(v->MPdisp_val);
-    } else if (key_equal(v->current, buttons[KEY_FINC_SLN])) {
+    } else if (v->current->id == KEY_FINC_SLN) {
         calc_sln(v->MPdisp_val);
-    } else if (key_equal(v->current, buttons[KEY_FINC_SYD])) {
+    } else if (v->current->id == KEY_FINC_SYD) {
         calc_syd(v->MPdisp_val);
-    } else if (key_equal(v->current, buttons[KEY_FINC_TERM])) {
+    } else if (v->current->id == KEY_FINC_TERM) {
         calc_term(v->MPdisp_val);
     }
     show_display(v->MPdisp_val);
@@ -258,6 +258,8 @@
     char *buf;
     int orig_len, dest_len;
     struct exprm_state *e;
+    
+    printf("exp_append(\"%s\")\n", text);
 
     if (!text) {
         return;
@@ -284,6 +286,8 @@
 void
 exp_insert(char *text)
 {
+    printf("exp_insert(\"%s\")\n", text);
+    
     // struct exprm_state *e;
     // e = get_state();
     // write_display(e->expression);
@@ -298,6 +302,8 @@
 void 
 exp_del() 
 {
+    printf("exp_del()\n");
+    
     struct exprm_state *e = get_state();
     free(e->expression);
     e->expression = NULL;
@@ -349,6 +355,8 @@
 void
 exp_replace(char *text)
 {
+    printf("exp_replace(\"%s\")\n", text);
+    
     struct exprm_state *e = get_state();
     free(e->expression);
     e->expression = NULL;
@@ -498,6 +506,8 @@
     struct exprm_state *e;
     int non_empty_expression;
 
+    printf("do_expression\n");
+
     update_statusbar("", "");
 
     e = get_state();
@@ -510,6 +520,8 @@
     trig_filter(&btext);
   
     non_empty_expression = !!(e->expression && strlen(e->expression));
+    
+    printf("expression = '%s'\n", e->expression);
 
     if (non_empty_expression) {
 	if (!strcmp(e->expression, "Ans")) {
@@ -541,14 +553,14 @@
         set_error_state(FALSE);
         MPstr_to_num("0", DEC, e->ans);
     } else if (e->button.flags & regrcl) {
-        int i = char_val(e->button.value[0]);
+        int i = char_val(e->value);
         char reg[3];
         int n = '0' +  i;
 
         snprintf(reg, 3, "R%c", n);
         exp_append(reg);
     } else if (e->button.flags & con) {
-        int *MPval = v->MPcon_vals[char_val(e->button.value[0])];
+        int *MPval = v->MPcon_vals[char_val(e->value)];
 
         exp_append(make_number(MPval, v->base, FALSE));
     } else if (e->button.flags & bsp) {
@@ -585,8 +597,10 @@
     } else if (e->button.flags & enter) {
 	  if (e->expression) {
 	    if (strcmp(e->expression, "Ans")) {
+		printf("solve = '%s'\n", e->expression);
 		  int MPval[MP_SIZE];
 		  int ret = ce_parse(e->expression, MPval);
+		 printf("solve ->%d\n", ret);
 
 		  if (!ret) {
 			mpstr(MPval, e->ans);
@@ -652,9 +666,11 @@
     double dval, dres;
     int MP1[MP_SIZE], MP2[MP_SIZE];
 
+    printf("do_calc\n");
+
     if (!(v->opsptr && !v->show_paren)) {  /* Don't do if processing parens. */
-        if (key_equal(v->current, buttons[KEY_CALCULATE]) && 
-            IS_KEY(v->old_cal_value, buttons[KEY_CALCULATE].value[0])) {
+        if (v->current->id == KEY_CALCULATE && 
+            v->old_cal_value == KEY_CALCULATE) {
             if (v->new_input) {
                 mpstr(v->MPlast_input, v->MPresult);
             } else {
@@ -662,32 +678,31 @@
             }
         }
     }
-
-    if (!key_equal(v->current, buttons[KEY_CALCULATE]) && 
-        IS_KEY(v->old_cal_value, buttons[KEY_CALCULATE].value[0])) {
-        v->cur_op = '?';
+    
+    if (v->current->id != KEY_CALCULATE && 
+        v->old_cal_value == KEY_CALCULATE) {
+        v->cur_op = -1;
     }
 
-    if (IS_KEY(v->cur_op, buttons[KEY_COSINE].value[0]) ||            /* Cos */
-        IS_KEY(v->cur_op, buttons[KEY_SINE].value[0]) ||            /* Sin */
-        IS_KEY(v->cur_op, buttons[KEY_TANGENT].value[0]) ||            /* Tan */
-        v->cur_op == '?') {                               /* Undefined */
+    if (v->cur_op == KEY_COSINE ||          /* Cos */
+        v->cur_op == KEY_SINE ||            /* Sin */
+        v->cur_op == KEY_TANGENT ||         /* Tan */
+	v->cur_op == -1) {                  /* Undefined */
         mpstr(v->MPdisp_val, v->MPresult);
 
-    } else if (IS_KEY(v->cur_op, buttons[KEY_ADD].value[0])) {     /* Addition */
+    } else if (v->cur_op == KEY_ADD) {     /* Addition */
         mpadd(v->MPresult, v->MPdisp_val, v->MPresult);
 
-    } else if (IS_KEY(v->cur_op, buttons[KEY_SUBTRACT].value[0])) {     /* Subtraction. */
+    } else if (v->cur_op == KEY_SUBTRACT) {     /* Subtraction. */
         mpsub(v->MPresult, v->MPdisp_val, v->MPresult);
 
-    } else if (v->cur_op == '*' ||
-               IS_KEY(v->cur_op, buttons[KEY_MULTIPLY].value[0])) {     /* Multiplication */
+    } else if (v->cur_op == KEY_MULTIPLY) {     /* Multiplication */
         mpmul(v->MPresult, v->MPdisp_val, v->MPresult);
 
-    } else if (IS_KEY(v->cur_op, buttons[KEY_DIVIDE].value[0])) {     /* Division. */
+    } else if (v->cur_op == KEY_DIVIDE) {     /* Division. */
         mpdiv(v->MPresult, v->MPdisp_val, v->MPresult);
 
-    } else if (IS_KEY(v->cur_op, buttons[KEY_MODULUS_DIVIDE].value[0])) {     /* Modulus. */
+    } else if (v->cur_op == KEY_MODULUS_DIVIDE) {     /* Modulus. */
         mpcmim(v->MPresult, MP1);
         mpcmim(v->MPdisp_val, MP2);
         if (!mpeq(v->MPresult, MP1) || !mpeq(v->MPdisp_val, MP2)) {
@@ -699,49 +714,49 @@
         mpmul(MP1, v->MPdisp_val, MP2);
         mpsub(v->MPresult, MP2, v->MPresult);
 
-    } else if (IS_KEY(v->cur_op, buttons[KEY_X_POW_Y].value[0])) {    /* y^x */
+    } else if (v->cur_op == KEY_X_POW_Y) {    /* y^x */
         calc_xpowy(v->MPresult, v->MPdisp_val, v->MPresult);
 
-    } else if (IS_KEY(v->cur_op, buttons[KEY_AND].value[0])) {     /* AND */
+    } else if (v->cur_op == KEY_AND) {     /* AND */
         mpcmd(v->MPresult, &dres);
         mpcmd(v->MPdisp_val, &dval);
         dres = setbool(ibool(dres) & ibool(dval));
         mpcdm(&dres, v->MPresult);
 
-    } else if (IS_KEY(v->cur_op, buttons[KEY_OR].value[0])) {      /* OR */
+    } else if (v->cur_op == KEY_OR) {      /* OR */
         mpcmd(v->MPresult, &dres);
         mpcmd(v->MPdisp_val, &dval);
         dres = setbool(ibool(dres) | ibool(dval));
         mpcdm(&dres, v->MPresult);
 
-    } else if (IS_KEY(v->cur_op, buttons[KEY_XOR].value[0])) {     /* XOR */
+    } else if (v->cur_op == KEY_XOR) {     /* XOR */
         mpcmd(v->MPresult, &dres);
         mpcmd(v->MPdisp_val, &dval);
         dres = setbool(ibool(dres) ^ ibool(dval));
         mpcdm(&dres, v->MPresult); 
 
-    } else if (IS_KEY(v->cur_op, buttons[KEY_XNOR].value[0])) {    /* XNOR */
+    } else if (v->cur_op == KEY_XNOR) {    /* XNOR */
         mpcmd(v->MPresult, &dres);
         mpcmd(v->MPdisp_val, &dval);
         dres = setbool(~ibool(dres) ^ ibool(dval));
         mpcdm(&dres, v->MPresult); 
 
-    } else if (IS_KEY(v->cur_op, buttons[KEY_CALCULATE].value[0])) {      /* Equals */
+    } else if (v->cur_op == KEY_CALCULATE) {      /* Equals */
         /* do nothing */;
     }
 
     show_display(v->MPresult);
 
-    if (!(key_equal(v->current, buttons[KEY_CALCULATE]) && 
-          IS_KEY(v->old_cal_value, buttons[KEY_CALCULATE].value[0]))) {
+    if (!(v->current->id == KEY_CALCULATE &&
+	v->old_cal_value == KEY_CALCULATE)) {
         mpstr(v->MPdisp_val, v->MPlast_input);
     }
 
     mpstr(v->MPresult, v->MPdisp_val);
-    if (!key_equal(v->current, buttons[KEY_CALCULATE])) {
-        v->cur_op = v->current->value[0];
+    if (v->current->id != KEY_CALCULATE) {
+        v->cur_op = v->current->id;
     }
-    v->old_cal_value = v->current->value[0];
+    v->old_cal_value = v->current->id;
     v->new_input     = v->key_exp = 0;
 }
 
@@ -756,9 +771,9 @@
         return(-EINVAL);
     }
 
-    sin_key = (key_equal(v->current, buttons[KEY_SINE])) ? 1 : 0;
-    cos_key = (key_equal(v->current, buttons[KEY_COSINE])) ? 1 : 0;
-    tan_key = (key_equal(v->current, buttons[KEY_TANGENT])) ? 1 : 0;
+    sin_key = (v->current->id == KEY_SINE) ? 1 : 0;
+    cos_key = (v->current->id == KEY_COSINE) ? 1 : 0;
+    tan_key = (v->current->id == KEY_TANGENT) ? 1 : 0;
   
     if (sin_key) {
         tfunc = SIN;
@@ -842,7 +857,7 @@
     
     switch (v->syntax) {
     case npa:
-	v->pending = 0;
+	v->pending = -1;
 	if (v->rstate) {
 	    make_registers();
 	}
@@ -874,12 +889,12 @@
 static void
 do_constant()
 {
-    assert(v->current->value[0] >= '0');
-    assert(v->current->value[0] <= '9');
+    assert(v->current_value >= '0');
+    assert(v->current_value <= '9');
     
     switch (v->syntax) {
         case npa: {
-	    int *MPval = v->MPcon_vals[char_val(v->current->value[0])];
+	    int *MPval = v->MPcon_vals[char_val(v->current_value)];
 
 	    mpstr(MPval, v->MPdisp_val);
 	    break;
@@ -943,8 +958,8 @@
     switch (v->syntax) {
         case npa: {
             mpstr(v->MPdisp_val, MPtemp);
-            mpstr(v->MPmvals[char_val(v->current->value[0])], v->MPdisp_val);
-            mpstr(MPtemp, v->MPmvals[char_val(v->current->value[0])]);
+            mpstr(v->MPmvals[char_val(v->current_value)], v->MPdisp_val);
+            mpstr(MPtemp, v->MPmvals[char_val(v->current_value)]);
             make_registers();
         }
         break;
@@ -952,7 +967,7 @@
         case exprs: {
               struct exprm_state *e = get_state();
               int ret = usable_num(MPexpr);
-              int n = char_val(e->button.value[0]);
+              int n = char_val(e->value);
 
               if (ret) {
                   update_statusbar(_("No sane value to store"), 
@@ -1052,10 +1067,10 @@
 
     switch (v->syntax) {
         case npa:
-            assert(v->current->value[0] >= '0');
-            assert(v->current->value[0] <= '9');
+            assert(v->current_value >= '0');
+            assert(v->current_value <= '9');
 
-            fno = char_val(v->current->value[0]);
+            fno = char_val(v->current_value);
             ret = 0;
             str = v->fun_vals[fno];
             assert(str);
@@ -1066,10 +1081,10 @@
         case exprs: {
             struct exprm_state *e = get_state();
 
-            assert(e->button.value[0] >= '0');
-            assert(e->button.value[0] <= '9');
+            assert(e->value >= '0');
+            assert(e->value <= '9');
 
-            fno = char_val(e->button.value[0]);
+            fno = char_val(e->value);
             ret = 0;
             str = v->fun_vals[fno];
             assert(str);
@@ -1095,36 +1110,36 @@
 {
     int MP1[MP_SIZE];
 
-    if (key_equal(v->current, buttons[KEY_MASK_32])) {                  /* &32 */
+    if (v->current->id == KEY_MASK_32) {                  /* &32 */
         calc_u32(s, t);
-    } else if (key_equal(v->current, buttons[KEY_MASK_16])) {           /* &16 */
+    } else if (v->current->id == KEY_MASK_16) {           /* &16 */
         calc_u16(s, t);
-    } else if (key_equal(v->current, buttons[KEY_E_POW_X])) {         /* e^x  */
+    } else if (v->current->id == KEY_E_POW_X) {         /* e^x  */
         mpstr(s, MP1);
         mpexp(MP1, t);
-    } else if (key_equal(v->current, buttons[KEY_10_POW_X])) {         /* 10^x */
+    } else if (v->current->id == KEY_10_POW_X) {         /* 10^x */
         calc_tenpowx(s, t);
-    } else if (key_equal(v->current, buttons[KEY_NATURAL_LOGARITHM])) {           /* Ln */
+    } else if (v->current->id == KEY_NATURAL_LOGARITHM) {           /* Ln */
         mpstr(s, MP1);
         mpln(MP1, t);
-    } else if (key_equal(v->current, buttons[KEY_LOGARITHM])) {          /* Log */
+    } else if (v->current->id == KEY_LOGARITHM) {          /* Log */
         mplog10(s, t);
-    } else if (key_equal(v->current, buttons[KEY_RANDOM])) {         /* Rand */
+    } else if (v->current->id == KEY_RANDOM) {         /* Rand */
         calc_rand(t);
-    } else if (key_equal(v->current, buttons[KEY_SQUARE_ROOT])) {         /* Sqrt */
+    } else if (v->current->id == KEY_SQUARE_ROOT) {         /* Sqrt */
         mpstr(s, MP1);
         mpsqrt(MP1, t);
-    } else if (key_equal(v->current, buttons[KEY_NOT])) {          /* NOT */
+    } else if (v->current->id == KEY_NOT) {          /* NOT */
         calc_not(t, s);
-    } else if (key_equal(v->current, buttons[KEY_RECIPROCAL])) {          /* 1/x */
+    } else if (v->current->id == KEY_RECIPROCAL) {          /* 1/x */
         calc_inv(s, t);
-    } else if (key_equal(v->current, buttons[KEY_FACTORIAL])) {         /* x! */
+    } else if (v->current->id == KEY_FACTORIAL) {         /* x! */
         do_factorial(s, MP1);
         mpstr(MP1, t);
-    } else if (key_equal(v->current, buttons[KEY_SQUARE])) {          /* x^2 */
+    } else if (v->current->id == KEY_SQUARE) {          /* x^2 */
         mpstr(s, MP1);
         mpmul(MP1, MP1, t);
-    } else if (key_equal(v->current, buttons[KEY_CHANGE_SIGN])) {          /* +/- */
+    } else if (v->current->id == KEY_CHANGE_SIGN) {          /* +/- */
          if (v->key_exp) {
              if (*v->exp_posn == '+') {
                  *v->exp_posn = '-';
@@ -1179,36 +1194,20 @@
 void
 do_number()
 {
-    char nextchar;
-    int len, n;
-    static int maxvals[4] = { 1, 7, 9, 15 };
-
-    nextchar = toupper(v->current->value[0]);
-    n = v->current->value[0];
+    int offset;
     
-    if (isdigit(n)) {
-        n = n - '0';
-    } else if (isupper(n)) {
-        n = n - 'A' + 10;
-    } else {
-        n = n - 'a' + 10;
-    }
-    
-    if (n > maxvals[(int) v->base]) {
-        /* TODO: add an error message to the status bar. */
-        beep();
-        return;
-    }
+    printf("do_number\n");
 
     if (v->toclear) {
-        SNPRINTF(v->display, MAXLINE, "%c", nextchar);
+	printf("toclear\n");
+	offset = 0;
         v->toclear = 0;
     } else {
-        len = strlen(v->display);
-        if (len < MAX_DIGITS) {
-	    SNPRINTF(v->display+len, MAXLINE, "%c", nextchar);
-        }
+        offset = strlen(v->display);
     }
+    if (offset < MAXLINE)
+	SNPRINTF(v->display+offset, MAXLINE-offset, "%s", v->current->symname);
+
     set_display(v->display, TRUE);
     MPstr_to_num(v->display, v->base, v->MPdisp_val);
     v->new_input = 1;
@@ -1223,7 +1222,7 @@
 
     switch (v->syntax) {
     case npa:
-        v->pending = 0;
+        v->pending = -1;
         if (v->rstate) {
             make_registers();
         }
@@ -1257,23 +1256,24 @@
 void
 do_paren()
 {
+    printf("do_paren\n");
+    
     update_statusbar("", "");
 
-    if (key_equal(v->current, buttons[KEY_START_BLOCK])) {
-        v->pending = v->current->value[0];
-        if (!v->noparens) {
-            if (v->cur_op == '?') {
+    if (v->current->id == KEY_START_BLOCK) {
+	v->pending = v->current->id;
+        if (v->noparens == 0) {
+            if (v->cur_op == -1) {
 	        v->display[0] = 0;
 	        update_statusbar(_("Cleared display, prefix without an operator is not allowed"), "");
             } else {
                 paren_disp(v->cur_op);
             }
-            v->pending_op = v->cur_op;
         }
         v->noparens++;
     }
 
-    if (v->noparens && key_equal(v->current, buttons[KEY_END_BLOCK])) {
+    if (v->noparens && v->current->id == KEY_END_BLOCK) {
         v->noparens--;
         if (!v->noparens) {
             int ret, i = 0;
@@ -1285,7 +1285,7 @@
             ret = lr_parse(&v->display[i], v->MPdisp_val);
             if (!ret) {
 	        show_display(v->MPdisp_val);
-	        v->pending = 0;
+	        v->pending = -1;
 	        return;
             } else {
                 update_statusbar(_("Malformed parenthesis expression"), 
@@ -1293,14 +1293,14 @@
             }
         }
     }
-    paren_disp(v->current->value[0]);
+    paren_disp(v->current->id);
 }
 
 
 static void
 do_sto()
 {
-    int n = char_val(v->current->value[0]);
+    int n = char_val(v->current_value);
 
     switch (v->syntax) {
         case npa:
@@ -1347,7 +1347,7 @@
 {
     switch (v->syntax) {
         case npa: {
-            int i = char_val(v->current->value[0]);
+            int i = char_val(v->current_value);
 
             mpstr(v->MPmvals[i], v->MPdisp_val);
             break;
@@ -1405,55 +1405,58 @@
 void
 do_pending()
 {
+    printf("do_pending\n");
+
     if (!v->ismenu &&
-        !IS_KEY(v->pending, buttons[KEY_START_BLOCK].value[0])) {
+        !(v->pending == KEY_START_BLOCK)) {
         show_menu();
     }
 
-    if (IS_KEY(v->pending, buttons[KEY_CONSTANTS_MENU].value[0]))  {                 /* Con */
+    if (v->pending == KEY_CONSTANTS_MENU)  {                 /* Con */
         do_constant();
 	v->new_input = 1;
 	syntaxdep_show_display();
-    } else if (IS_KEY(v->pending, buttons[KEY_EXCHANGE].value[0])) {          /* Exch */
+    } else if (v->pending == KEY_EXCHANGE) {          /* Exch */
         do_exchange();
 	v->new_input = 1;
 	syntaxdep_show_display();
-    } else if (IS_KEY(v->pending, buttons[KEY_FUNCTIONS_MENU].value[0]))  {          /* Fun */
+    } else if (v->pending == KEY_FUNCTIONS_MENU)  {          /* Fun */
         do_function();
 	v->new_input = 1;
-    } else if (IS_KEY(v->pending, buttons[KEY_STORE].value[0])) {
+    } else if (v->pending == KEY_STORE) {
         do_sto();
-    } else if (IS_KEY(v->pending, buttons[KEY_RECALL].value[0])) {
+    } else if (v->pending == KEY_RECALL) {
        do_rcl();
        v->new_input = 1;
        syntaxdep_show_display();
-    } else if (IS_KEY(v->pending, buttons[KEY_LEFT_SHIFT].value[0])) {          /* < */
+    } else if (v->pending == KEY_LEFT_SHIFT) {          /* < */
         do_shift(left);
 	v->new_input = 1;
 	syntaxdep_show_display();
-    } else if (IS_KEY(v->pending, buttons[KEY_RIGHT_SHIFT].value[0])) {          /* > */
+    } else if (v->pending == KEY_RIGHT_SHIFT) {          /* > */
         do_shift(right);
 	v->new_input = 1;
 	syntaxdep_show_display();
-    } else if (IS_KEY(v->pending, buttons[KEY_ACCURACY_MENU].value[0])) {           /* Acc */
+    } else if (v->pending == KEY_ACCURACY_MENU) {           /* Acc */
         do_accuracy();
 	syntaxdep_show_display();
-    } else if (IS_KEY(v->pending, buttons[KEY_START_BLOCK].value[0])) {          /* ( */
+    } else if (v->pending == KEY_START_BLOCK) {          /* ( */
         do_paren();
         return;
-    } else if (!v->pending) {
-        save_pending_values(v->current);
-        v->pending_op = buttons[KEY_CALCULATE].value[0];
+    } else if (v->pending < 0) {
+        v->pending = v->current->id;
         return;
     }
 
-    v->pending = 0;
+    v->pending = -1;
 }
 
 
 void
 do_point()                   /* Handle numeric point. */
 {
+    printf("do_point\n");
+    
     if (!v->pointed) {
         if (v->toclear) {
             STRCPY(v->display, ".");
@@ -1473,15 +1476,15 @@
 {
     int MP1[MP_SIZE];
 
-    if (key_equal(v->current, buttons[KEY_ABSOLUTE_VALUE])) {                       /* Abs */
+    if (v->current->id == KEY_ABSOLUTE_VALUE) {                       /* Abs */
         mpstr(num, MP1);
         mpabs(MP1, num);
 
-    } else if (key_equal(v->current, buttons[KEY_FRACTION])) {               /* Frac */
+    } else if (v->current->id == KEY_FRACTION) {               /* Frac */
         mpstr(num, MP1);
         mpcmf(MP1, num);
 
-    } else if (key_equal(v->current, buttons[KEY_INTEGER])) {                /* Int */
+    } else if (v->current->id == KEY_INTEGER) {                /* Int */
         mpstr(num, MP1);
         mpcmim(MP1, num);
     }
@@ -1514,15 +1517,15 @@
             double dval;
       
             for (i = 0; i <= 15; i++) {
-                if (v->current->value[0] == get_menu_entry(mtype, i)) {
-	            shift = char_val(v->current->value[0]);
+                if (v->current_value == get_menu_entry(mtype, i)) {
+	            shift = char_val(v->current_value);
 	            MPstr_to_num(v->display, v->base, MPtemp);
 	            mpcmd(MPtemp, &dval);
 	            temp = ibool(dval);
 	  
-	            if (IS_KEY(v->pending, buttons[KEY_LEFT_SHIFT].value[0])) {
+	            if (v->pending == KEY_LEFT_SHIFT) {
 	                temp = temp << shift;
-	            } else if (IS_KEY(v->pending, buttons[KEY_RIGHT_SHIFT].value[0])) {
+	            } else if (v->pending == KEY_RIGHT_SHIFT) {
 	                temp = temp >> shift;
 	            }
 
@@ -1539,7 +1542,7 @@
         case exprs: {
 	    struct exprm_state *e = get_state();
             int MPval[MP_SIZE];
-            int n = char_val(e->button.value[0]);
+            int n = char_val(e->value);
             int ret = usable_num(MPval);
 
             if (ret || !is_integer(MPval)) {
@@ -1565,23 +1568,16 @@
 {
     v->ttype = t;
     put_resource(R_TRIG, Rtstr[(int) v->ttype]);
-    if (IS_KEY(v->cur_op, buttons[KEY_COSINE].value[0]) ||
-        IS_KEY(v->cur_op, buttons[KEY_SINE].value[0]) ||
-        IS_KEY(v->cur_op, buttons[KEY_TANGENT].value[0])) {
+    if (v->cur_op == KEY_COSINE ||
+        v->cur_op == KEY_SINE ||
+        v->cur_op == KEY_TANGENT) {
         mpstr(v->MPtresults[(int) v->ttype], v->MPdisp_val);
         show_display(v->MPtresults[(int) v->ttype]);
     }
-    v->pending = 0;
+    v->pending = -1;
 }
 
 
-int
-key_equal(struct button *x, struct button y)
-{
-    return(x->value[0] == y.value[0] && x->mods[0] == y.mods[0]);
-}
-
-
 void
 push_num(int *MPval)        /* Try to push value onto the numeric stack. */
 {
@@ -1620,14 +1616,6 @@
 
 
 void
-save_pending_values(struct button *but)
-{
-    v->pending_but = but;
-    v->pending = but->value[0];
-}
-
-
-void
 set_main_title(enum mode_type modetype)  /* Set the title for main window. */
 {
     char title[MAXLINE];
@@ -1647,31 +1635,3 @@
 {
     update_statusbar(message, "gtk-dialog-error");
 }
-
-struct button *
-button_for_value(int val)
-{
-    int i;
-
-    for (i = 0; i < NKEYS; i++) {
-        if (buttons[i].value[0] == val) {
-            return(&buttons[i]);
-        }
-    }
-
-    return(NULL);
-}
-
-struct button *
-button_for_fc(char ch)
-{
-    int i;
- 
-    for (i = 0; i < NKEYS; i++) {
-        if (buttons[i].func_char == ch) {
-            return(&buttons[i]);
-        }
-    }    
- 
-    return(NULL);
-}
Index: gcalctool/extern.h
===================================================================
--- gcalctool/extern.h	(revision 1761)
+++ gcalctool/extern.h	(working copy)
@@ -47,7 +47,6 @@
 extern double max_fix[];       /* Maximum showable fixed values. */
 
 extern int basevals[];         /* Supported arithmetic bases. */
-extern int validkeys[];        /* Valid keys after an error condition. */
 extern int cur_pos[];          /* Current positions - left/right handed. */
 
 extern struct button buttons[];         /* Calculator button values. */
Index: gcalctool/get.c
===================================================================
--- gcalctool/get.c	(revision 1761)
+++ gcalctool/get.c	(working copy)
@@ -263,7 +263,6 @@
 
     v->error       = 0;            /* No calculator error initially. */
     v->key_exp     = 0;            /* Not entering an exponent number. */
-    v->pending_op  = 0;            /* No pending arithmetic operation. */
     v->titleline   = NULL;         /* No User supplied title line. */
 
     read_str(&v->iconlabel, _("calculator"));  /* Default icon label. */
Index: gcalctool/gtk.c
===================================================================
--- gcalctool/gtk.c	(revision 1761)
+++ gcalctool/gtk.c	(working copy)
@@ -262,8 +262,6 @@
 static gboolean dismiss_aframe(GtkWidget *, GdkEvent *, gpointer);
 static gboolean dismiss_rframe(GtkWidget *, GdkEvent *, gpointer);
 static gboolean dismiss_spframe(GtkWidget *, GdkEvent *, gpointer);
-static gboolean kframe_key_press_cb(GtkWidget *, GdkEventKey *);
-static gboolean kframe_key_release_cb(GtkWidget *, GdkEventKey *);
 static gboolean display_focus_in_cb(GtkWidget *, GdkEventKey *);
 static gboolean display_focus_out_cb(GtkWidget *, GdkEventKey *);
 static gboolean mouse_button_cb(GtkWidget *, GdkEventButton *);
@@ -282,7 +280,7 @@
 static void accuracy_other_cb(GtkWidget *);
 static void arithmetic_mode_cb(GtkWidget *);
 static void mode_radio_cb(GtkWidget *);
-static void menu_pos_func(GtkMenu *, gint *, gint *, gboolean *, gpointer);
+static void menu_pos_fucn(GtkMenu *, gint *, gint *, gboolean *, gpointer);
 static void menu_proc_cb(GtkMenuItem *, gpointer);
 static void menu_button_button_press_cb(GtkButton *);
 static gboolean menu_button_key_press_cb(GtkWidget *, GdkEventKey *);
@@ -504,14 +502,17 @@
 button_cb(GtkWidget *widget)
 {
     struct button *n;
+    
+    printf("button_cb\n");
 
     n = (struct button *) g_object_get_data(G_OBJECT(widget), "button");
     assert(n);
 
     switch (v->syntax) {
         case npa:
-            if (v->pending) {
-                if (v->current != NULL) {
+            if (v->pending >= 0) {
+		printf("button_cb pending=1\n");
+		if (v->current != NULL) {
 	            free(v->current);
                 }
                 v->current = copy_button_info(n);
@@ -527,28 +528,20 @@
             break;
 
         case exprs:
-		  { 
-                      if ((n->flags) & pending) {
-                          if (v->current != NULL) {
-                              free(v->current);
-                          }
-                          v->current = copy_button_info(n);
-                          do_pending();
-                      } else if (((n->flags) & hex) &&  (v->base != HEX)) {
-                          // Do nothing
-                      } else if (((n->flags) & number) && 
-                                 (((v->base == BIN) && !(n->flags & bin_set))
-                                  || ((v->base == OCT) && !(n->flags & oct_set)))) {
-                          // Do nothing
-                      } else {
-			struct exprm_state *e = get_state();
-			memcpy(&(e->button), n, sizeof(struct button));
-			new_state();
-			do_expression();
-			set_bit_panel();
-                      }
-		  }
-		  break;
+            if ((n->flags) & pending) {
+                if (v->current != NULL) {
+                    free(v->current);
+                }
+                v->current = copy_button_info(n);
+                do_pending();
+            } else {
+                struct exprm_state *e = get_state();
+                memcpy(&(e->button), n, sizeof(struct button));
+                new_state();
+                do_expression();
+                set_bit_panel();
+            }
+            break;
 
         default:
             assert(0);
@@ -633,9 +626,9 @@
 
     gtk_widget_destroy(GTK_WIDGET(dialog));
     if (mtype == M_CON) {
-	X->con_dialog = NULL;
+        X->con_dialog = NULL;
     } else {
-	X->fun_dialog = NULL;
+        X->fun_dialog = NULL;
     }
 }
 
@@ -786,15 +779,15 @@
         vbox = gtk_vbox_new(FALSE, 6);
         gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
 
-	str = g_strconcat("<small><i><b>", _("Note:"), "</b> ", 
+        str = g_strconcat("<small><i><b>", _("Note:"), "</b> ", 
             _("All constant values are specified in the decimal numeric base."),
             "</i></small>", NULL); 
-	label = gtk_label_new(_(str));
-	g_free(str);
-	gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
-	gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
-	gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
-	gtk_box_pack_end(GTK_BOX(vbox), label, FALSE, FALSE, 0);
+        label = gtk_label_new(_(str));
+        g_free(str);
+        gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
+        gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
+        gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
+        gtk_box_pack_end(GTK_BOX(vbox), label, FALSE, FALSE, 0);
 
         label = gtk_label_new_with_mnemonic(
                     _("Click a _value or description to edit it:"));
@@ -810,7 +803,7 @@
                                        GTK_POLICY_NEVER);
         gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0);
 
-	model = create_cf_model(mtype, dialog);
+        model = create_cf_model(mtype, dialog);
 
         treeview = gtk_tree_view_new_with_model(model);
         gtk_label_set_mnemonic_widget(GTK_LABEL(label), treeview);
@@ -860,7 +853,7 @@
 
         switch (v->modetype) {
             case FINANCIAL:
-	        radio = GET_WIDGET("view_financial_menu");
+                radio = GET_WIDGET("view_financial_menu");
                 break;
 
             case SCIENTIFIC:
@@ -1126,26 +1119,24 @@
     X->ui = glade_xml_new(UI_FILE, NULL, NULL);
     if (X->ui == NULL)
     {
-	GtkWidget *dialog;
-	
-	dialog = gtk_message_dialog_new(NULL, 0,
-					GTK_MESSAGE_ERROR,
-					GTK_BUTTONS_NONE,
-					N_("Error loading user interface"));
-	gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
-						 N_("The user interace file %s is missing or unable to be loaded. Please check your installation."), UI_FILE);
-	gtk_dialog_add_buttons(GTK_DIALOG(dialog), GTK_STOCK_QUIT, GTK_RESPONSE_ACCEPT, NULL);
-	
-	gtk_dialog_run(GTK_DIALOG(dialog));
-	exit(0);
+        GtkWidget *dialog;
+        
+        dialog = gtk_message_dialog_new(NULL, 0,
+                                        GTK_MESSAGE_ERROR,
+                                        GTK_BUTTONS_NONE,
+                                        N_("Error loading user interface"));
+        gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
+                                                 N_("The user interace file %s is missing or unable to be loaded. Please check your installation."), UI_FILE);
+        gtk_dialog_add_buttons(GTK_DIALOG(dialog), GTK_STOCK_QUIT, GTK_RESPONSE_ACCEPT, NULL);
+        
+        gtk_dialog_run(GTK_DIALOG(dialog));
+        exit(0);
     }
 
     // When connecting up signals, would ideally use autoconnect but not sure how to get the build process
     // working. See http://library.gnome.org/devel/libglade/unstable and
     // http://www.jamesh.id.au/software/libglade/ for some information on how to get this to work
     //glade_xml_signal_autoconnect(X->ui);
-    CONNECT_SIGNAL(kframe_key_press_cb);
-    CONNECT_SIGNAL(kframe_key_release_cb);
     CONNECT_SIGNAL(button_cb);
     CONNECT_SIGNAL(menu_button_button_press_cb);
     CONNECT_SIGNAL(menu_button_key_press_cb);
@@ -1222,16 +1213,16 @@
     
     size_group = gtk_size_group_new(GTK_SIZE_GROUP_BOTH);
     for (i = 0; i < NBUTTONS; i++) {
-	SNPRINTF(name, MAXLINE, "calc_%s_button", 
+        SNPRINTF(name, MAXLINE, "calc_%s_button", 
                  button_widgets[i].widget_name);
-	X->buttons[i] = GET_WIDGET(name);
-	assert(X->buttons[i] != NULL);
-	
-	gtk_size_group_add_widget(size_group, X->buttons[i]);
-	
-	g_object_set_data(G_OBJECT(X->buttons[i]), "button", 
+        X->buttons[i] = GET_WIDGET(name);
+        assert(X->buttons[i] != NULL);
+        
+        gtk_size_group_add_widget(size_group, X->buttons[i]);
+        
+        g_object_set_data(G_OBJECT(X->buttons[i]), "button", 
                           &buttons[button_widgets[i].key]);
-	g_object_set_data(G_OBJECT(X->buttons[i]), "mtype", 
+        g_object_set_data(G_OBJECT(X->buttons[i]), "mtype", 
                           GINT_TO_POINTER(button_widgets[i].mtype));
     }
 
@@ -1249,20 +1240,20 @@
     X->inv = GET_WIDGET("inverse_check");
     X->hyp = GET_WIDGET("hyperbolic_check");
     for (i = 0; i < 3; i++)
-	g_object_set_data(G_OBJECT(X->trig[i]), "response_id", GINT_TO_POINTER(i));
+        g_object_set_data(G_OBJECT(X->trig[i]), "response_id", GINT_TO_POINTER(i));
     for (i = 0; i < 4; i++)
-	g_object_set_data(G_OBJECT(X->base[i]), "response_id", GINT_TO_POINTER(i));
-    for (i = 0; i < 3; i++)	
-	g_object_set_data(G_OBJECT(X->disp[i]), "response_id", GINT_TO_POINTER(i));
+        g_object_set_data(G_OBJECT(X->base[i]), "response_id", GINT_TO_POINTER(i));
+    for (i = 0; i < 3; i++)        
+        g_object_set_data(G_OBJECT(X->disp[i]), "response_id", GINT_TO_POINTER(i));
       
     X->bit_panel = GET_WIDGET("bit_panel");
     //gtk_widget_set_direction(table, GTK_TEXT_DIR_LTR);
     for (i = 0; i < MAXBITS; i++)
     {
         SNPRINTF(name, MAXLINE, "bit_label_%d", i);
-	X->bits[i] = GET_WIDGET(name);
-	SNPRINTF(name, MAXLINE, "bit_eventbox_%d", i);
-	g_object_set_data(G_OBJECT(GET_WIDGET(name)), "widget_index", GINT_TO_POINTER(i));
+        X->bits[i] = GET_WIDGET(name);
+        SNPRINTF(name, MAXLINE, "bit_eventbox_%d", i);
+        g_object_set_data(G_OBJECT(GET_WIDGET(name)), "widget_index", GINT_TO_POINTER(i));
     }
 
     set_accuracy_tooltip(v->accuracy);
@@ -1286,7 +1277,7 @@
             break;
 
         case SCIENTIFIC:
-	    widget = GET_WIDGET("view_scientific_menu");
+            widget = GET_WIDGET("view_scientific_menu");
             break;
 
         case ADVANCED:
@@ -1340,10 +1331,10 @@
     /* Connect up menu callbacks */
     for(i = 1; i < 16; i++)
     {
-	SNPRINTF(name, MAXLINE, "shift_left%d_menu", i);
-	g_object_set_data(G_OBJECT(GET_WIDGET(name)), "shiftcount", GINT_TO_POINTER(i));
-	SNPRINTF(name, MAXLINE, "shift_right%d_menu", i);
-	g_object_set_data(G_OBJECT(GET_WIDGET(name)), "shiftcount", GINT_TO_POINTER(i));
+        SNPRINTF(name, MAXLINE, "shift_left%d_menu", i);
+        g_object_set_data(G_OBJECT(GET_WIDGET(name)), "shiftcount", GINT_TO_POINTER(i));
+        SNPRINTF(name, MAXLINE, "shift_right%d_menu", i);
+        g_object_set_data(G_OBJECT(GET_WIDGET(name)), "shiftcount", GINT_TO_POINTER(i));
     }
     g_object_set_data(G_OBJECT(GET_WIDGET("view_basic_menu")), "calcmode", GINT_TO_POINTER(BASIC));
     g_object_set_data(G_OBJECT(GET_WIDGET("view_advanced_menu")), "calcmode", GINT_TO_POINTER(ADVANCED));
@@ -1355,11 +1346,23 @@
     gtk_window_add_accel_group(GTK_WINDOW(X->kframe), accel_group);
     for(i = 0; i < 10; i++)
     {
-	SNPRINTF(name, MAXLINE, "acc_item%d", i);
-	widget = GET_WIDGET(name);
-	g_object_set_data(G_OBJECT(widget), "index", GINT_TO_POINTER(i));
-	gtk_widget_add_accelerator(widget, "activate", accel_group, GDK_0 + i, GDK_CONTROL_MASK, 0);
-    }    
+        SNPRINTF(name, MAXLINE, "acc_item%d", i);
+        widget = GET_WIDGET(name);
+        g_object_set_data(G_OBJECT(widget), "index", GINT_TO_POINTER(i));
+        gtk_widget_add_accelerator(widget, "activate", accel_group, GDK_0 + i, GDK_CONTROL_MASK, 0);
+    }
+    
+    /* Glade doesn't support the GDK_R* keys so add them manually */
+    accel_group = gtk_accel_group_new();
+    gtk_window_add_accel_group(GTK_WINDOW(X->kframe), accel_group);
+    gtk_widget_add_accelerator(X->buttons[BUT_1], "activate", accel_group, GDK_R13, 0, 0);
+    gtk_widget_add_accelerator(X->buttons[BUT_3], "activate", accel_group, GDK_R15, 0, 0);
+    gtk_widget_add_accelerator(X->buttons[BUT_5], "activate", accel_group, GDK_R11, 0, 0);
+    gtk_widget_add_accelerator(X->buttons[BUT_7], "activate", accel_group, GDK_R7, 0, 0);
+    gtk_widget_add_accelerator(X->buttons[BUT_9], "activate", accel_group, GDK_R9, 0, 0);
+    //gtk_widget_add_accelerator(X->buttons[BUT_SUBTRACT], "activate", accel_group, GDK_R4, 0, 0);
+    //gtk_widget_add_accelerator(X->buttons[BUT_DIVIDE], "activate", accel_group, GDK_R5, 0, 0);
+    //gtk_widget_add_accelerator(X->buttons[BUT_MULTIPLY], "activate", accel_group, GDK_R6, 0, 0);
 }
 
 static void
@@ -1373,8 +1376,8 @@
 
     for (i = 0; i < MAXREGS; i++) {
         SNPRINTF(mstr, MAXLINE, "<span weight=\"bold\">%s_%d:</span>    %s",
-	/* translators: R is the short form of register used inter alia
-	in popup menus */
+        /* translators: R is the short form of register used inter alia
+        in popup menus */
                 _("R"), i, make_number(v->MPmvals[i], v->base, TRUE));
         create_menu_item_with_markup(mstr, m, i);
     }
@@ -1521,9 +1524,9 @@
             if (!strlen(v->fun_vals[i])) {
                 invalid = 1;
             } else {
-	      SNPRINTF(mline, MAXLINE,
+              SNPRINTF(mline, MAXLINE,
                       "<span weight=\"bold\">%s_%1d:</span> %s [%s]", 
-		      _("F"), i, v->fun_vals[i], v->fun_names[i]);
+                      _("F"), i, v->fun_vals[i], v->fun_names[i]);
             }
         }
 
@@ -1561,7 +1564,7 @@
 disp_cb(GtkWidget *widget)
 {
     if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)))
-	do_numtype((enum num_type) g_object_get_data(G_OBJECT(widget), "response_id"));
+        do_numtype((enum num_type) g_object_get_data(G_OBJECT(widget), "response_id"));
 }
 
 
@@ -1829,7 +1832,7 @@
 help_cb(GtkWidget *widget)
 {
     if (v->started)
-	help_display();
+        help_display();
 }
 
 
@@ -1933,90 +1936,6 @@
     return(FALSE);
 }
 
-
-static gboolean
-kframe_key_release_cb(GtkWidget *widget, GdkEventKey *event)
-{
-    if (gtk_widget_is_focus(X->display_item) && (v->syntax == exprs)) {
-        if ((event->keyval == GDK_equal)
-            || (event->keyval == GDK_KP_Enter)
-            || (event->keyval == GDK_Return)
-            || (event->keyval == GDK_equal)) {
-        } else {
-            new_state();
-            get_expr_from_display();
-        }
-    }
-    return(FALSE);
-}
-
-
-/*ARGSUSED*/
-static gboolean
-kframe_key_press_cb(GtkWidget *widget, GdkEventKey *event)
-{
-    int i, j, state;
-    struct button *button;
-    gboolean visible;
-
-    if (gtk_widget_is_focus(X->display_item) && (v->syntax == exprs)) {
-
-        if ((event->keyval == GDK_equal) || 
-            (event->keyval == GDK_KP_Enter) || 
-            (event->keyval == GDK_Return) || 
-            (event->keyval == GDK_equal)) {
-            get_expr_from_display();
-        } else {
-            return(FALSE);
-        }
-    }
-
-    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);
-    for (i = 0; i < NBUTTONS; i++) {
-	GtkWidget *parent = gtk_widget_get_parent(X->buttons[i]);
-	visible = parent == X->core_panel;
-	switch (X->mode)
-	{
-	case BASIC:
-	    visible |= parent == X->bas_panel;
-	    break;
-
-	case ADVANCED:
-	    visible |= parent == X->adv_panel;
-	    break;
-
-	case FINANCIAL:
-	    visible |= (parent == X->adv_panel || parent == X->fin_panel);
-	    break;
-
-	case SCIENTIFIC:
-	    visible |= (parent == X->adv_panel || parent == X->sci_panel);
-	    break;
-	}
-	if (!visible)
-	    continue;
-
-        j = 0;
-	button = &buttons[button_widgets[i].key];
-        while (button->value[j] != 0) {
-            if (button->value[j] == event->keyval) {
-                if ((button->mods[j] & ~GDK_SHIFT_MASK) == state) {
-                    button_cb(X->buttons[i]);
-                    return(TRUE);
-                }
-            }
-            j++;
-        }
-    }
-    
-    return(FALSE);
-}
-
 void
 load_resources()        /* Load gconf configuration database for gcalctool. */
 { 
@@ -2173,7 +2092,7 @@
 void
 menu_cancel_cb(GtkWidget *widget)
 {
-    v->pending = 0;
+    v->pending = -1;
 }
 
 
@@ -2216,9 +2135,9 @@
 {
     enum menu_type mtype = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(mi), "mtype"));
 
-    v->current->value[0] = '0' + GPOINTER_TO_INT(user_data);
+    v->current_value = '0' + GPOINTER_TO_INT(user_data);
     
-    handle_menu_selection(X->mrec[mtype], v->current->value[0]);
+    handle_menu_selection(X->mrec[mtype], v->current_value);
 }
 
 
@@ -2301,17 +2220,17 @@
 {
     if (v->started)
     {
-	perform_undo();
-	refresh_display();
+        perform_undo();
+        refresh_display();
     }
 }
-	
+        
 static void redo_cb(GtkWidget *widget)
 {
     if (v->started)
     {
-	perform_redo();
-	refresh_display();
+        perform_redo();
+        refresh_display();
     }
 }
 
@@ -2327,8 +2246,8 @@
     
     if (v->started)
     {
-	choice += (choice < 10) ? '0' : 'A' - 10;
-	handle_menu_selection(X->mrec[(int) M_LSHF], choice);
+        choice += (choice < 10) ? '0' : 'A' - 10;
+        handle_menu_selection(X->mrec[(int) M_LSHF], choice);
     }
 }
 
@@ -2347,9 +2266,9 @@
 {
     if (v->started)
     {
-	  v->bitcalculating_mode = v->bitcalculating_mode ^ 1;
-	  set_mode(v->modetype);
-	  put_resource(R_BITCALC, Rcstr[v->bitcalculating_mode]);
+          v->bitcalculating_mode = v->bitcalculating_mode ^ 1;
+          set_mode(v->modetype);
+          put_resource(R_BITCALC, Rcstr[v->bitcalculating_mode]);
     }
 }
 
@@ -2357,7 +2276,7 @@
 {
     if (v->started)
     {
-	v->rstate = !v->rstate;
+        v->rstate = !v->rstate;
         do_memory();
     }
 }
@@ -2379,21 +2298,21 @@
             MPstr_to_num("0", DEC, v->MPdisp_val);
             show_display(v->MPdisp_val);
             update_statusbar(_("Activated no operator precedence mode"), "");
-	    clear_undo_history();
+            clear_undo_history();
             break;
 
     case exprs: {
-	struct exprm_state *e = get_state();
-	MPstr_to_num("0", DEC, e->ans);
-	exp_del();
-	show_display(e->ans);
-	update_statusbar(
-			 _("Activated expression mode with operator precedence"), "");
+        struct exprm_state *e = get_state();
+        MPstr_to_num("0", DEC, e->ans);
+        exp_del();
+        show_display(e->ans);
+        update_statusbar(
+                         _("Activated expression mode with operator precedence"), "");
    }
-	break;
-	
+        break;
+        
     default:
-	assert(0);
+        assert(0);
     }
     put_resource(R_SYNTAX, Rsstr[v->syntax]);
     set_mode(v->modetype);
@@ -2410,10 +2329,10 @@
     int complete = 0;     /* Set if the user has completed a calculation. */
 
     if (!gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(radio)))
-	return;
+        return;
 
     if (!v->started) {
-	return;
+        return;
     }
 
     X->mode = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(radio), "calcmode"));
@@ -2434,18 +2353,18 @@
 
     switch (v->syntax) {
         case npa:
-            if (v->old_cal_value == '?' ||
-                IS_KEY(v->old_cal_value, buttons[KEY_CALCULATE].value[0])) {
+            if (v->old_cal_value < 0 ||
+                v->old_cal_value == KEY_CALCULATE) {
                 complete = 1;    /* Calculation is complete. */
             }
             break;
 
-	    case exprs: {
-		  	struct exprm_state *e = get_state();
+            case exprs: {
+                          struct exprm_state *e = get_state();
             if (!e->expression || !strcmp(e->expression, "Ans")) {
                 complete = 1;   /* Calculation is complete. */
             }
-	}
+        }
             break;
     }
 
@@ -2487,7 +2406,7 @@
 accuracy_other_cb(GtkWidget *widget)
 {
     if (v->started)    
-	show_precision_frame();
+        show_precision_frame();
 }
 
 /*ARGSUSED*/
@@ -2495,16 +2414,16 @@
 show_trailing_zeroes_cb(GtkWidget *widget)
 {
     if (!v->doing_mi) {
-	v->show_zeroes = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget));
+        v->show_zeroes = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget));
 
-	syntaxdep_show_display();
-	put_resource(R_ZEROES, set_bool(v->show_zeroes == TRUE));
-	make_registers();
-	
-	set_show_zeroes_toggle(v->show_zeroes);
+        syntaxdep_show_display();
+        put_resource(R_ZEROES, set_bool(v->show_zeroes == TRUE));
+        make_registers();
+        
+        set_show_zeroes_toggle(v->show_zeroes);
     }
 
-    v->pending = 0;
+    v->pending = -1;
 }
 
 
@@ -2732,8 +2651,8 @@
 
 void
 bin_str(int MP_value[MP_SIZE], 
-		char *str, 
-		int maxbits)
+                char *str, 
+                int maxbits)
 {
   
   int MP0[MP_SIZE];
@@ -2749,27 +2668,27 @@
   MPstr_to_num("2", DEC, MP2);
 
   if (mplt(MP_value, MP0)) {
-	mpcmim(MP_value, MP0);
-	mpadd(MP0, MP1, MP0);
-	neg = 1;
+        mpcmim(MP_value, MP0);
+        mpadd(MP0, MP1, MP0);
+        neg = 1;
   } else {
-	mpcmim(MP_value, MP0);
+        mpcmim(MP_value, MP0);
   }
  
   for (i = 0; i < maxbits; i++) {
 
-	double lsb;               /* Least significant bit. */
-	calc_and(MP3, MP0, MP1);
-	mpcmd(MP3, &lsb);
+        double lsb;               /* Least significant bit. */
+        calc_and(MP3, MP0, MP1);
+        mpcmd(MP3, &lsb);
 
-	if (lsb == 0) {
-	  str[maxbits - i -1] = (neg) ? '1' : '0';
-	} else {
-	  str[maxbits - i -1] = (neg) ? '0' : '1';
-	} 
+        if (lsb == 0) {
+          str[maxbits - i -1] = (neg) ? '1' : '0';
+        } else {
+          str[maxbits - i -1] = (neg) ? '0' : '1';
+        } 
 
-	mpdiv(MP0, MP2, MP3);
-	mpcmim(MP3, MP0);
+        mpdiv(MP0, MP2, MP3);
+        mpcmim(MP3, MP0);
   }
 
   return;
@@ -2780,55 +2699,55 @@
 
     switch (v->syntax) {
     case npa:
-	  {
-		int bit_str_len, i, MP1[MP_SIZE], MP2[MP_SIZE];
-		
-		MPstr_to_num(v->display, v->base, MP1);
-		mpcmim(MP1, MP2);
-		if (mpeq(MP1, MP2)) {
-		  char *bit_str, label[3], tmp[MAXLINE];
-		  int toclear = (key_equal(v->current, buttons[KEY_CLEAR_ENTRY])) ? TRUE : FALSE;
-		  
-		  bit_str = make_fixed(MP1, tmp, BIN, MAXLINE, toclear);
-		  bit_str_len = strlen(bit_str);
-		  if (bit_str_len <= MAXBITS) {
+          {
+                int bit_str_len, i, MP1[MP_SIZE], MP2[MP_SIZE];
+                
+                MPstr_to_num(v->display, v->base, MP1);
+                mpcmim(MP1, MP2);
+                if (mpeq(MP1, MP2)) {
+                  char *bit_str, label[3], tmp[MAXLINE];
+                  int toclear = (v->current->id == KEY_CLEAR_ENTRY) ? TRUE : FALSE;
+                  
+                  bit_str = make_fixed(MP1, tmp, BIN, MAXLINE, toclear);
+                  bit_str_len = strlen(bit_str);
+                  if (bit_str_len <= MAXBITS) {
             gtk_widget_set_sensitive(X->bit_panel, TRUE);
-			
+                        
             STRCPY(label, " 0");
             for (i = 0; i < MAXBITS; i++) {
-			  label[1] = (i < bit_str_len) ? bit_str[bit_str_len-i-1] : '0';
-			  gtk_label_set_text(GTK_LABEL(X->bits[MAXBITS - i - 1]), label);
+                          label[1] = (i < bit_str_len) ? bit_str[bit_str_len-i-1] : '0';
+                          gtk_label_set_text(GTK_LABEL(X->bits[MAXBITS - i - 1]), label);
             }
-			
+                        
             return;
-		  }
-		}
-		gtk_widget_set_sensitive(X->bit_panel, FALSE);
-		
-	  }
-	  break;
-	case exprs:
-	  {
-		int MP[MP_SIZE];
-		int i;
-		char str[64], label[3];
-		int ret = usable_num(MP);
+                  }
+                }
+                gtk_widget_set_sensitive(X->bit_panel, FALSE);
+                
+          }
+          break;
+        case exprs:
+          {
+                int MP[MP_SIZE];
+                int i;
+                char str[64], label[3];
+                int ret = usable_num(MP);
 
-		if (ret || !is_integer(MP)) {
-		  gtk_widget_set_sensitive(X->bit_panel, FALSE);
-		  return;
-		}
-		bin_str(MP, str, 64);
-		gtk_widget_set_sensitive(X->bit_panel, TRUE);
-		
-		STRCPY(label, " 0");
-		for (i = 0; i < 64; i++) {
-		  label[1] = str[64 - i - 1];
-		  gtk_label_set_text(GTK_LABEL(X->bits[64 - i - 1]), label);
-		}
-	  }
-	  break;
-	}
+                if (ret || !is_integer(MP)) {
+                  gtk_widget_set_sensitive(X->bit_panel, FALSE);
+                  return;
+                }
+                bin_str(MP, str, 64);
+                gtk_widget_set_sensitive(X->bit_panel, TRUE);
+                
+                STRCPY(label, " 0");
+                for (i = 0; i < 64; i++) {
+                  label[1] = str[64 - i - 1];
+                  gtk_label_set_text(GTK_LABEL(X->bits[64 - i - 1]), label);
+                }
+          }
+          break;
+        }
 }
 
 
@@ -2848,8 +2767,8 @@
         str = " ";
     } else {
       if (!v->noparens) {
-      	localize_number(localized, str);
-	str = localized;
+              localize_number(localized, str);
+        str = localized;
       }
     }
     buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(X->display_item));
@@ -2893,7 +2812,8 @@
     GtkTextBuffer *buffer;
     GtkTextIter start, end;
 
-    if (str == NULL || *str == 0) str = " ";
+    printf("write_display(\"%s\")\n", str);
+    if (str == NULL ) str = "";
 
     buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(X->display_item));
     gtk_text_buffer_get_bounds(buffer, &start, &end);
@@ -3017,7 +2937,7 @@
             gtk_widget_show(X->adv_panel);
             gtk_widget_hide(X->fin_panel);
             gtk_widget_show_all(X->mode_panel);
-			if (v->bitcalculating_mode) {
+                        if (v->bitcalculating_mode) {
                 gtk_widget_show_all(X->bit_panel);
             } else {
                 gtk_widget_hide(X->bit_panel);
@@ -3155,21 +3075,21 @@
     GtkWidget *button = NULL;
     GdkEvent *event = gtk_get_current_event();
 
-       if (key_equal(v->current, buttons[KEY_ACCURACY_MENU])) {       /* Acc */
+       if (v->current->id == KEY_ACCURACY_MENU) {       /* Acc */
         button = X->buttons[BUT_ACCURACY_MENU];
-    } else if (key_equal(v->current, buttons[KEY_CONSTANTS_MENU])) {  /* Con */
+    } else if (v->current->id == KEY_CONSTANTS_MENU) {  /* Con */
         button = X->buttons[BUT_CONSTANTS_MENU];
-    } else if (key_equal(v->current, buttons[KEY_EXCHANGE])) {        /* Exch */
+    } else if (v->current->id == KEY_EXCHANGE) {        /* Exch */
         button = X->buttons[BUT_EXCHANGE];
-    } else if (key_equal(v->current, buttons[KEY_FUNCTIONS_MENU])) {  /* Fun */
+    } else if (v->current->id == KEY_FUNCTIONS_MENU) {  /* Fun */
         button = X->buttons[BUT_FUNCTIONS_MENU];
-    } else if (key_equal(v->current, buttons[KEY_LEFT_SHIFT])) {      /* < */
+    } else if (v->current->id == KEY_LEFT_SHIFT) {      /* < */
         button = X->buttons[BUT_LEFT_SHIFT];
-    } else if (key_equal(v->current, buttons[KEY_RECALL])) {          /* Rcl */
+    } else if (v->current->id == KEY_RECALL) {          /* Rcl */
         button = X->buttons[BUT_RECALL];
-    } else if (key_equal(v->current, buttons[KEY_RIGHT_SHIFT])) {     /* > */
+    } else if (v->current->id == KEY_RIGHT_SHIFT) {     /* > */
         button = X->buttons[BUT_RIGHT_SHIFT];
-    } else if (key_equal(v->current, buttons[KEY_STORE])) {           /* Sto */
+    } else if (v->current->id == KEY_STORE) {           /* Sto */
         button = X->buttons[BUT_STORE];
     }
 
@@ -3216,7 +3136,7 @@
 trig_cb(GtkWidget *widget)
 {
     if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)))
-	do_trigtype((enum trig_type) g_object_get_data(G_OBJECT(widget), "response_id"));
+        do_trigtype((enum trig_type) g_object_get_data(G_OBJECT(widget), "response_id"));
 }
 
 
@@ -3232,16 +3152,16 @@
 
     switch (v->syntax) { 
         case npa:
-	    break;
+            break;
 
-     	case exprs: {
-	    /* Init expression mode.
-	     * This must be executed after do_base is called at init.
-	     * FIXME: The init code here is duplicated elsewhere.
+             case exprs: {
+            /* Init expression mode.
+             * This must be executed after do_base is called at init.
+             * FIXME: The init code here is duplicated elsewhere.
              */
             struct exprm_state *e = get_state();
 
-	    MPstr_to_num("0", DEC, e->ans);
+            MPstr_to_num("0", DEC, e->ans);
             exp_del();
             show_display(e->ans);
         }
@@ -3260,7 +3180,7 @@
 show_thousands_separator_cb(GtkWidget *widget)
 {
     if (!v->started) {
-	return;
+        return;
     }
 
     v->show_tsep = !v->show_tsep;
@@ -3300,50 +3220,50 @@
 static void
 help_display(void)
 {
-	GError *error = NULL;
-	char *command;
-	const char *lang;
-	char *uri = NULL;
-	GdkScreen *gscreen;
+        GError *error = NULL;
+        char *command;
+        const char *lang;
+        char *uri = NULL;
+        GdkScreen *gscreen;
 
-	int i;
+        int i;
 
-	const char * const * langs = g_get_language_names ();
+        const char * const * langs = g_get_language_names ();
 
-	for (i = 0; langs[i]; i++) {
-		lang = langs[i];
-		if (strchr (lang, '.')) {
-			continue;
-		}
+        for (i = 0; langs[i]; i++) {
+                lang = langs[i];
+                if (strchr (lang, '.')) {
+                        continue;
+                }
 
-		uri = g_build_filename(PACKAGE_DATA_DIR,
-				       "/gnome/help/gcalctool/",
-					lang,
-				       "/gcalctool.xml",
-					NULL);
-					
-		if (g_file_test (uri, G_FILE_TEST_EXISTS)) {
+                uri = g_build_filename(PACKAGE_DATA_DIR,
+                                       "/gnome/help/gcalctool/",
+                                        lang,
+                                       "/gcalctool.xml",
+                                        NULL);
+                                        
+                if (g_file_test (uri, G_FILE_TEST_EXISTS)) {
                     break;
-		}
-	}
-	
-	command = g_strconcat ("gnome-open ghelp://", uri, NULL);
-	gscreen = gdk_screen_get_default();
-	gdk_spawn_command_line_on_screen (gscreen, command, &error);
-	if (error) {
-		GtkWidget *d;
+                }
+        }
+        
+        command = g_strconcat ("gnome-open ghelp://", uri, NULL);
+        gscreen = gdk_screen_get_default();
+        gdk_spawn_command_line_on_screen (gscreen, command, &error);
+        if (error) {
+                GtkWidget *d;
 
-	    d = gtk_message_dialog_new(NULL,
-				GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
-				GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
-				error->message);
-		gtk_dialog_run(GTK_DIALOG(d));
-		gtk_widget_destroy(d);
-		g_error_free(error);
-		error = NULL;
-	}
+            d = gtk_message_dialog_new(NULL,
+                                GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+                                GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
+                                error->message);
+                gtk_dialog_run(GTK_DIALOG(d));
+                gtk_widget_destroy(d);
+                g_error_free(error);
+                error = NULL;
+        }
 
-	g_free (command);
-	g_free (uri);
+        g_free (command);
+        g_free (uri);
 }
 
Index: glade/gcalctool.glade
===================================================================
--- glade/gcalctool.glade	(revision 1761)
+++ glade/gcalctool.glade	(working copy)
@@ -19,8 +19,6 @@
   <property name="focus_on_map">True</property>
   <property name="urgency_hint">False</property>
   <signal name="delete_event" handler="quit_cb"/>
-  <signal name="key_press_event" handler="kframe_key_press_cb"/>
-  <signal name="key_release_event" handler="kframe_key_release_cb"/>
 
   <child>
     <widget class="GtkVBox" id="kvbox">
@@ -417,7 +415,7 @@
 		  <property name="left_margin">0</property>
 		  <property name="right_margin">6</property>
 		  <property name="indent">0</property>
-		  <property name="text" translatable="yes">5</property>
+		  <property name="text" translatable="no"></property>
 		  <accessibility>
 		    <atkproperty name="AtkObject::accessible_description" translatable="yes">Result Region</atkproperty>
 		  </accessibility>
@@ -803,17 +801,17 @@
 	  <child>
 	    <widget class="GtkButton" id="calc_finc_sum_of_the_years_digits_depreciation_button">
 	      <property name="visible">True</property>
-	      <property name="tooltip" translatable="yes">Sum-of-the years'-digits depreciation [Y]</property>
-	      <property name="can_focus">True</property>
+	      <property name="tooltip" translatable="yes">Sum-of-the years'-digits depreciation [y]</property>
 	      <property name="label" translatable="yes">Syd</property>
 	      <property name="use_underline">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
+	      <property name="focus_on_click">False</property>
 	      <accessibility>
 		<atkproperty name="AtkObject::accessible_name" translatable="yes">Sum-of-the years'-digits depreciation</atkproperty>
-		<atkproperty name="AtkObject::accessible_description" translatable="yes">Sum-of-the years'-digits depreciation [Y]</atkproperty>
+		<atkproperty name="AtkObject::accessible_description" translatable="yes">Sum-of-the years'-digits depreciation [y]</atkproperty>
 	      </accessibility>
 	      <signal name="clicked" handler="button_cb"/>
+	      <accelerator key="y" modifiers="0" signal="activate"/>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">7</property>
@@ -829,16 +827,16 @@
 	    <widget class="GtkButton" id="calc_finc_straight_line_depreciation_button">
 	      <property name="visible">True</property>
 	      <property name="tooltip" translatable="yes">Straight-line depreciation [l]</property>
-	      <property name="can_focus">True</property>
 	      <property name="label" translatable="yes">Sln</property>
 	      <property name="use_underline">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
+	      <property name="focus_on_click">False</property>
 	      <accessibility>
 		<atkproperty name="AtkObject::accessible_name" translatable="yes">Straight-line depreciation</atkproperty>
 		<atkproperty name="AtkObject::accessible_description" translatable="yes">Straight-line depreciation [l]</atkproperty>
 	      </accessibility>
 	      <signal name="clicked" handler="button_cb"/>
+	      <accelerator key="l" modifiers="0" signal="activate"/>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">6</property>
@@ -854,16 +852,16 @@
 	    <widget class="GtkButton" id="calc_finc_periodic_interest_rate_button">
 	      <property name="visible">True</property>
 	      <property name="tooltip" translatable="yes">Periodic interest rate [T]</property>
-	      <property name="can_focus">True</property>
 	      <property name="label" translatable="yes">Rate</property>
 	      <property name="use_underline">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
+	      <property name="focus_on_click">False</property>
 	      <accessibility>
 		<atkproperty name="AtkObject::accessible_name" translatable="yes">Periodic interest rate</atkproperty>
 		<atkproperty name="AtkObject::accessible_description" translatable="yes">Periodic interest rate [T]</atkproperty>
 	      </accessibility>
 	      <signal name="clicked" handler="button_cb"/>
+	      <accelerator key="T" modifiers="GDK_SHIFT_MASK" signal="activate"/>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">5</property>
@@ -879,16 +877,16 @@
 	    <widget class="GtkButton" id="calc_finc_present_value_button">
 	      <property name="visible">True</property>
 	      <property name="tooltip" translatable="yes">Present value [p]</property>
-	      <property name="can_focus">True</property>
 	      <property name="label" translatable="yes">Pv</property>
 	      <property name="use_underline">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
+	      <property name="focus_on_click">False</property>
 	      <accessibility>
 		<atkproperty name="AtkObject::accessible_name" translatable="yes">Present value</atkproperty>
 		<atkproperty name="AtkObject::accessible_description" translatable="yes">Present value [p]</atkproperty>
 	      </accessibility>
 	      <signal name="clicked" handler="button_cb"/>
+	      <accelerator key="p" modifiers="0" signal="activate"/>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">4</property>
@@ -904,16 +902,16 @@
 	    <widget class="GtkButton" id="calc_finc_periodic_payment_button">
 	      <property name="visible">True</property>
 	      <property name="tooltip" translatable="yes">Periodic payment [P]</property>
-	      <property name="can_focus">True</property>
 	      <property name="label" translatable="yes">Pmt</property>
 	      <property name="use_underline">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
+	      <property name="focus_on_click">False</property>
 	      <accessibility>
 		<atkproperty name="AtkObject::accessible_name" translatable="yes">Periodic payment</atkproperty>
 		<atkproperty name="AtkObject::accessible_description" translatable="yes">Periodic payment [P]</atkproperty>
 	      </accessibility>
 	      <signal name="clicked" handler="button_cb"/>
+	      <accelerator key="P" modifiers="GDK_SHIFT_MASK" signal="activate"/>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">3</property>
@@ -929,16 +927,16 @@
 	    <widget class="GtkButton" id="calc_finc_future_value_button">
 	      <property name="visible">True</property>
 	      <property name="tooltip" translatable="yes">Future value [v]</property>
-	      <property name="can_focus">True</property>
 	      <property name="label" translatable="yes">Fv</property>
 	      <property name="use_underline">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
+	      <property name="focus_on_click">False</property>
 	      <accessibility>
 		<atkproperty name="AtkObject::accessible_name" translatable="yes">Future value</atkproperty>
 		<atkproperty name="AtkObject::accessible_description" translatable="yes">Future value [v]</atkproperty>
 	      </accessibility>
 	      <signal name="clicked" handler="button_cb"/>
+	      <accelerator key="v" modifiers="0" signal="activate"/>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">2</property>
@@ -954,16 +952,16 @@
 	    <widget class="GtkButton" id="calc_finc_double_declining_depreciation_button">
 	      <property name="visible">True</property>
 	      <property name="tooltip" translatable="yes">Double-declining depreciation [D]</property>
-	      <property name="can_focus">True</property>
 	      <property name="label" translatable="yes">Ddb</property>
 	      <property name="use_underline">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
+	      <property name="focus_on_click">False</property>
 	      <accessibility>
 		<atkproperty name="AtkObject::accessible_name" translatable="yes">Double-declining depreciation</atkproperty>
 		<atkproperty name="AtkObject::accessible_description" translatable="yes">Double-declining depreciation [D]</atkproperty>
 	      </accessibility>
 	      <signal name="clicked" handler="button_cb"/>
+	      <accelerator key="D" modifiers="GDK_SHIFT_MASK" signal="activate"/>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">1</property>
@@ -979,16 +977,16 @@
 	    <widget class="GtkButton" id="calc_finc_compounding_term_button">
 	      <property name="visible">True</property>
 	      <property name="tooltip" translatable="yes">Compounding term [m]</property>
-	      <property name="can_focus">True</property>
 	      <property name="label" translatable="yes">Ctrm</property>
 	      <property name="use_underline">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
+	      <property name="focus_on_click">False</property>
 	      <accessibility>
 		<atkproperty name="AtkObject::accessible_name" translatable="yes">Compounding term</atkproperty>
 		<atkproperty name="AtkObject::accessible_description" translatable="yes">Compounding term [m]</atkproperty>
 	      </accessibility>
 	      <signal name="clicked" handler="button_cb"/>
+	      <accelerator key="m" modifiers="0" signal="activate"/>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">0</property>
@@ -1004,16 +1002,16 @@
 	    <widget class="GtkButton" id="calc_finc_term_button">
 	      <property name="visible">True</property>
 	      <property name="tooltip" translatable="yes">Payment period [t]</property>
-	      <property name="can_focus">True</property>
 	      <property name="label" translatable="yes">Term</property>
 	      <property name="use_underline">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
+	      <property name="focus_on_click">False</property>
 	      <accessibility>
 		<atkproperty name="AtkObject::accessible_name" translatable="yes">Payment period</atkproperty>
 		<atkproperty name="AtkObject::accessible_description" translatable="yes">Payment period [t]</atkproperty>
 	      </accessibility>
 	      <signal name="clicked" handler="button_cb"/>
+	      <accelerator key="t" modifiers="0" signal="activate"/>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">0</property>
@@ -4004,15 +4002,15 @@
 	    <widget class="GtkButton" id="calc_d_button">
 	      <property name="visible">True</property>
 	      <property name="tooltip" translatable="yes">Hexadecimal digit D [d]</property>
-	      <property name="can_focus">True</property>
 	      <property name="label" translatable="yes">D</property>
 	      <property name="use_underline">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
+	      <property name="focus_on_click">False</property>
 	      <accessibility>
 		<atkproperty name="AtkObject::accessible_name" translatable="yes">Hexadecimal digit D</atkproperty>
 	      </accessibility>
 	      <signal name="clicked" handler="button_cb"/>
+	      <accelerator key="d" modifiers="0" signal="activate"/>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">0</property>
@@ -4028,14 +4026,14 @@
 	    <widget class="GtkButton" id="calc_functions_button">
 	      <property name="visible">True</property>
 	      <property name="tooltip" translatable="yes">User-defined functions [F]</property>
-	      <property name="can_focus">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
+	      <property name="focus_on_click">False</property>
 	      <accessibility>
 		<atkproperty name="AtkObject::accessible_name" translatable="yes">User-defined functions</atkproperty>
 	      </accessibility>
 	      <signal name="clicked" handler="menu_button_button_press_cb"/>
 	      <signal name="key-press-event" handler="menu_button_key_press_cb"/>
+	      <accelerator key="F" modifiers="GDK_SHIFT_MASK" signal="activate"/>
 
 	      <child>
 		<widget class="GtkHBox" id="hbox13">
@@ -4105,14 +4103,14 @@
 	    <widget class="GtkButton" id="calc_shift_left_button">
 	      <property name="visible">True</property>
 	      <property name="tooltip" translatable="yes">Shift displayed value 1-15 places to the left [&lt;]</property>
-	      <property name="can_focus">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
+	      <property name="focus_on_click">False</property>
 	      <accessibility>
 		<atkproperty name="AtkObject::accessible_name" translatable="yes">Shift left</atkproperty>
 	      </accessibility>
 	      <signal name="clicked" handler="menu_button_button_press_cb"/>
 	      <signal name="key-press-event" handler="menu_button_key_press_cb"/>
+	      <accelerator key="less" modifiers="GDK_SHIFT_MASK" signal="activate"/>
 
 	      <child>
 		<widget class="GtkHBox" id="hbox11">
@@ -4182,14 +4180,14 @@
 	    <widget class="GtkButton" id="calc_shift_right_button">
 	      <property name="visible">True</property>
 	      <property name="tooltip" translatable="yes">Shift displayed value 1-15 places to the right [&gt;]</property>
-	      <property name="can_focus">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
+	      <property name="focus_on_click">False</property>
 	      <accessibility>
 		<atkproperty name="AtkObject::accessible_name" translatable="yes">Shift right</atkproperty>
 	      </accessibility>
 	      <signal name="clicked" handler="menu_button_button_press_cb"/>
 	      <signal name="key-press-event" handler="menu_button_key_press_cb"/>
+	      <accelerator key="greater" modifiers="GDK_SHIFT_MASK" signal="activate"/>
 
 	      <child>
 		<widget class="GtkHBox" id="hbox10">
@@ -4259,14 +4257,15 @@
 	    <widget class="GtkButton" id="calc_constants_button">
 	      <property name="visible">True</property>
 	      <property name="tooltip" translatable="yes">Constants [#]</property>
-	      <property name="can_focus">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
+	      <property name="focus_on_click">False</property>
 	      <accessibility>
 		<atkproperty name="AtkObject::accessible_name" translatable="yes">Constants</atkproperty>
 	      </accessibility>
 	      <signal name="clicked" handler="menu_button_button_press_cb"/>
 	      <signal name="key-press-event" handler="menu_button_key_press_cb"/>
+	      <accelerator key="numbersign" modifiers="0" signal="activate"/>
+	      <accelerator key="numbersign" modifiers="GDK_SHIFT_MASK" signal="activate"/>
 
 	      <child>
 		<widget class="GtkHBox" id="hbox12">
@@ -4336,14 +4335,14 @@
 	    <widget class="GtkButton" id="calc_accuracy_button">
 	      <property name="visible">True</property>
 	      <property name="tooltip" translatable="yes">Set accuracy from 0 to 9 numeric places [A]</property>
-	      <property name="can_focus">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
+	      <property name="focus_on_click">False</property>
 	      <accessibility>
 		<atkproperty name="AtkObject::accessible_name" translatable="yes">Accuracy</atkproperty>
 	      </accessibility>
 	      <signal name="clicked" handler="menu_button_button_press_cb"/>
 	      <signal name="key-press-event" handler="menu_button_key_press_cb"/>
+	      <accelerator key="A" modifiers="GDK_SHIFT_MASK" signal="activate"/>
 
 	      <child>
 		<widget class="GtkHBox" id="hbox14">
@@ -4412,15 +4411,15 @@
 	    <widget class="GtkButton" id="calc_modulus_divide_button">
 	      <property name="visible">True</property>
 	      <property name="tooltip" translatable="yes">Modulus Division [M]</property>
-	      <property name="can_focus">True</property>
 	      <property name="label" translatable="yes">Mod</property>
 	      <property name="use_underline">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
+	      <property name="focus_on_click">False</property>
 	      <accessibility>
 		<atkproperty name="AtkObject::accessible_name" translatable="yes">Modulus Division</atkproperty>
 	      </accessibility>
 	      <signal name="clicked" handler="button_cb"/>
+	      <accelerator key="M" modifiers="GDK_SHIFT_MASK" signal="activate"/>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">6</property>
@@ -4436,15 +4435,15 @@
 	    <widget class="GtkButton" id="calc_random_button">
 	      <property name="visible">True</property>
 	      <property name="tooltip" translatable="yes">Random number in the range 0.0 to 1.0 [?]</property>
-	      <property name="can_focus">True</property>
 	      <property name="label" translatable="yes" comments="Random number">Rand</property>
 	      <property name="use_underline">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
+	      <property name="focus_on_click">False</property>
 	      <accessibility>
 		<atkproperty name="AtkObject::accessible_name" translatable="yes">Random number</atkproperty>
 	      </accessibility>
 	      <signal name="clicked" handler="button_cb"/>
+	      <accelerator key="question" modifiers="GDK_SHIFT_MASK" signal="activate"/>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">7</property>
@@ -4460,11 +4459,10 @@
 	    <widget class="GtkButton" id="calc_xor_button">
 	      <property name="visible">True</property>
 	      <property name="tooltip" translatable="yes">Bitwise XOR [x]</property>
-	      <property name="can_focus">True</property>
 	      <property name="label" translatable="yes">XOR</property>
 	      <property name="use_underline">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
+	      <property name="focus_on_click">False</property>
 	      <accessibility>
 		<atkproperty name="AtkObject::accessible_name" translatable="yes">Bitwise XOR</atkproperty>
 	      </accessibility>
@@ -4484,15 +4482,15 @@
 	    <widget class="GtkButton" id="calc_xnor_button">
 	      <property name="visible">True</property>
 	      <property name="tooltip" translatable="yes">Bitwise XNOR [n]</property>
-	      <property name="can_focus">True</property>
 	      <property name="label" translatable="yes">XNOR</property>
 	      <property name="use_underline">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
+	      <property name="focus_on_click">False</property>
 	      <accessibility>
 		<atkproperty name="AtkObject::accessible_name" translatable="yes">Bitwise XNOR</atkproperty>
 	      </accessibility>
 	      <signal name="clicked" handler="button_cb"/>
+	      <accelerator key="n" modifiers="0" signal="activate"/>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">7</property>
@@ -4508,15 +4506,15 @@
 	    <widget class="GtkButton" id="calc_logarithm_button">
 	      <property name="visible">True</property>
 	      <property name="tooltip" translatable="yes">Base 10 log [G]</property>
-	      <property name="can_focus">True</property>
 	      <property name="label" translatable="yes">Log</property>
 	      <property name="use_underline">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
+	      <property name="focus_on_click">False</property>
 	      <accessibility>
 		<atkproperty name="AtkObject::accessible_name" translatable="yes">Base 10 Log</atkproperty>
 	      </accessibility>
 	      <signal name="clicked" handler="button_cb"/>
+	      <accelerator key="G" modifiers="GDK_SHIFT_MASK" signal="activate"/>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">7</property>
@@ -4532,15 +4530,15 @@
 	    <widget class="GtkButton" id="calc_natural_logarithm_button">
 	      <property name="visible">True</property>
 	      <property name="tooltip" translatable="yes">Natural log [N]</property>
-	      <property name="can_focus">True</property>
 	      <property name="label" translatable="yes">Ln</property>
 	      <property name="use_underline">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
+	      <property name="focus_on_click">False</property>
 	      <accessibility>
 		<atkproperty name="AtkObject::accessible_name" translatable="yes">Natural log</atkproperty>
 	      </accessibility>
 	      <signal name="clicked" handler="button_cb"/>
+	      <accelerator key="N" modifiers="GDK_SHIFT_MASK" signal="activate"/>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">6</property>
@@ -4556,15 +4554,15 @@
 	    <widget class="GtkButton" id="calc_tangent_button">
 	      <property name="visible">True</property>
 	      <property name="tooltip" translatable="yes">Tangent [L]</property>
-	      <property name="can_focus">True</property>
 	      <property name="label" translatable="yes">Tan</property>
 	      <property name="use_underline">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
+	      <property name="focus_on_click">False</property>
 	      <accessibility>
 		<atkproperty name="AtkObject::accessible_name" translatable="yes">Tangent</atkproperty>
 	      </accessibility>
 	      <signal name="clicked" handler="button_cb"/>
+	      <accelerator key="L" modifiers="GDK_SHIFT_MASK" signal="activate"/>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">5</property>
@@ -4580,16 +4578,16 @@
 	    <widget class="GtkButton" id="calc_not_button">
 	      <property name="visible">True</property>
 	      <property name="tooltip" translatable="yes">Bitwise NOT [~]</property>
-	      <property name="can_focus">True</property>
 	      <property name="label" translatable="yes">NOT</property>
 	      <property name="use_underline">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
+	      <property name="focus_on_click">False</property>
 	      <accessibility>
 		<atkproperty name="AtkObject::accessible_name" translatable="yes">Bitwise NOT</atkproperty>
 		<atkproperty name="AtkObject::accessible_description" translatable="yes">Bitwise NOT [~]</atkproperty>
 	      </accessibility>
 	      <signal name="clicked" handler="button_cb"/>
+	      <accelerator key="asciitilde" modifiers="GDK_SHIFT_MASK" signal="activate"/>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">5</property>
@@ -4605,15 +4603,15 @@
 	    <widget class="GtkButton" id="calc_and_button">
 	      <property name="visible">True</property>
 	      <property name="tooltip" translatable="yes">Bitwise AND [&amp;]</property>
-	      <property name="can_focus">True</property>
 	      <property name="label" translatable="yes">AND</property>
 	      <property name="use_underline">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
+	      <property name="focus_on_click">False</property>
 	      <accessibility>
 		<atkproperty name="AtkObject::accessible_name" translatable="yes">Bitwise AND</atkproperty>
 	      </accessibility>
 	      <signal name="clicked" handler="button_cb"/>
+	      <accelerator key="ampersand" modifiers="GDK_SHIFT_MASK" signal="activate"/>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">4</property>
@@ -4629,15 +4627,15 @@
 	    <widget class="GtkButton" id="calc_sine_button">
 	      <property name="visible">True</property>
 	      <property name="tooltip" translatable="yes">Sine [K]</property>
-	      <property name="can_focus">True</property>
 	      <property name="label" translatable="yes">Sin</property>
 	      <property name="use_underline">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
+	      <property name="focus_on_click">False</property>
 	      <accessibility>
 		<atkproperty name="AtkObject::accessible_name" translatable="yes">Sine</atkproperty>
 	      </accessibility>
 	      <signal name="clicked" handler="button_cb"/>
+	      <accelerator key="K" modifiers="GDK_SHIFT_MASK" signal="activate"/>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">4</property>
@@ -4653,15 +4651,15 @@
 	    <widget class="GtkButton" id="calc_mask_32_button">
 	      <property name="visible">True</property>
 	      <property name="tooltip" translatable="yes">32-bit unsigned integer value of display ([)</property>
-	      <property name="can_focus">True</property>
 	      <property name="label" translatable="yes" comments="32 bit unsigned integer">&amp;32</property>
 	      <property name="use_underline">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
+	      <property name="focus_on_click">False</property>
 	      <accessibility>
 		<atkproperty name="AtkObject::accessible_name" translatable="yes">32 bit unsigned integer</atkproperty>
 	      </accessibility>
 	      <signal name="clicked" handler="button_cb"/>
+	      <accelerator key="bracketleft" modifiers="0" signal="activate"/>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">3</property>
@@ -4677,15 +4675,15 @@
 	    <widget class="GtkButton" id="calc_or_button">
 	      <property name="visible">True</property>
 	      <property name="tooltip" translatable="yes">Bitwise OR [|]</property>
-	      <property name="can_focus">True</property>
 	      <property name="label" translatable="yes">OR</property>
 	      <property name="use_underline">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
+	      <property name="focus_on_click">False</property>
 	      <accessibility>
 		<atkproperty name="AtkObject::accessible_name" translatable="yes">Bitwise OR</atkproperty>
 	      </accessibility>
 	      <signal name="clicked" handler="button_cb"/>
+	      <accelerator key="bar" modifiers="GDK_SHIFT_MASK" signal="activate"/>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">3</property>
@@ -4701,15 +4699,15 @@
 	    <widget class="GtkButton" id="calc_cosine_button">
 	      <property name="visible">True</property>
 	      <property name="tooltip" translatable="yes">Cosine [J]</property>
-	      <property name="can_focus">True</property>
 	      <property name="label" translatable="yes">Cos</property>
 	      <property name="use_underline">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
+	      <property name="focus_on_click">False</property>
 	      <accessibility>
 		<atkproperty name="AtkObject::accessible_name" translatable="yes">Cosine</atkproperty>
 	      </accessibility>
 	      <signal name="clicked" handler="button_cb"/>
+	      <accelerator key="J" modifiers="GDK_SHIFT_MASK" signal="activate"/>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">3</property>
@@ -4725,15 +4723,15 @@
 	    <widget class="GtkButton" id="calc_mask_16_button">
 	      <property name="visible">True</property>
 	      <property name="tooltip" translatable="yes">16-bit unsigned integer value of display (])</property>
-	      <property name="can_focus">True</property>
 	      <property name="label" translatable="yes" comments="16 bit unsigned integer">&amp;16</property>
 	      <property name="use_underline">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
+	      <property name="focus_on_click">False</property>
 	      <accessibility>
 		<atkproperty name="AtkObject::accessible_name" translatable="yes">16 bit unsigned integer</atkproperty>
 	      </accessibility>
 	      <signal name="clicked" handler="button_cb"/>
+	      <accelerator key="bracketright" modifiers="0" signal="activate"/>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">2</property>
@@ -4749,15 +4747,15 @@
 	    <widget class="GtkButton" id="calc_exponential_button">
 	      <property name="visible">True</property>
 	      <property name="tooltip" translatable="yes">Enter an exponential number [E]</property>
-	      <property name="can_focus">True</property>
 	      <property name="label" translatable="yes" comments="Exponential">Exp</property>
 	      <property name="use_underline">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
+	      <property name="focus_on_click">False</property>
 	      <accessibility>
 		<atkproperty name="AtkObject::accessible_name" translatable="yes">Exponential</atkproperty>
 	      </accessibility>
 	      <signal name="clicked" handler="button_cb"/>
+	      <accelerator key="E" modifiers="GDK_SHIFT_MASK" signal="activate"/>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">2</property>
@@ -4773,15 +4771,15 @@
 	    <widget class="GtkButton" id="calc_f_button">
 	      <property name="visible">True</property>
 	      <property name="tooltip" translatable="yes">Hexadecimal digit F [f]</property>
-	      <property name="can_focus">True</property>
 	      <property name="label" translatable="yes">F</property>
 	      <property name="use_underline">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
+	      <property name="focus_on_click">False</property>
 	      <accessibility>
 		<atkproperty name="AtkObject::accessible_name" translatable="yes">Hexadecimal digit F</atkproperty>
 	      </accessibility>
 	      <signal name="clicked" handler="button_cb"/>
+	      <accelerator key="d" modifiers="0" signal="activate"/>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">2</property>
@@ -4797,15 +4795,15 @@
 	    <widget class="GtkButton" id="calc_c_button">
 	      <property name="visible">True</property>
 	      <property name="tooltip" translatable="yes">Hexadecimal digit C [c]</property>
-	      <property name="can_focus">True</property>
 	      <property name="label" translatable="yes">C</property>
 	      <property name="use_underline">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
+	      <property name="focus_on_click">False</property>
 	      <accessibility>
 		<atkproperty name="AtkObject::accessible_name" translatable="yes">Hexadecimal digit C</atkproperty>
 	      </accessibility>
 	      <signal name="clicked" handler="button_cb"/>
+	      <accelerator key="c" modifiers="0" signal="activate"/>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">2</property>
@@ -4821,15 +4819,15 @@
 	    <widget class="GtkButton" id="calc_b_button">
 	      <property name="visible">True</property>
 	      <property name="tooltip" translatable="yes">Hexadecimal digit B [b]</property>
-	      <property name="can_focus">True</property>
 	      <property name="label" translatable="yes">B</property>
 	      <property name="use_underline">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
+	      <property name="focus_on_click">False</property>
 	      <accessibility>
 		<atkproperty name="AtkObject::accessible_name" translatable="yes">Hexadecimal digit B</atkproperty>
 	      </accessibility>
 	      <signal name="clicked" handler="button_cb"/>
+	      <accelerator key="b" modifiers="0" signal="activate"/>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">1</property>
@@ -4845,15 +4843,15 @@
 	    <widget class="GtkButton" id="calc_e_button">
 	      <property name="visible">True</property>
 	      <property name="tooltip" translatable="yes">Hexadecimal digit E [e]</property>
-	      <property name="can_focus">True</property>
 	      <property name="label" translatable="yes">E</property>
 	      <property name="use_underline">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
+	      <property name="focus_on_click">False</property>
 	      <accessibility>
 		<atkproperty name="AtkObject::accessible_name" translatable="yes">Hexadecimal digit E</atkproperty>
 	      </accessibility>
 	      <signal name="clicked" handler="button_cb"/>
+	      <accelerator key="e" modifiers="0" signal="activate"/>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">1</property>
@@ -4869,15 +4867,15 @@
 	    <widget class="GtkButton" id="calc_a_button">
 	      <property name="visible">True</property>
 	      <property name="tooltip" translatable="yes">Hexadecimal digit A [a]</property>
-	      <property name="can_focus">True</property>
 	      <property name="label" translatable="yes">A</property>
 	      <property name="use_underline">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
+	      <property name="focus_on_click">False</property>
 	      <accessibility>
 		<atkproperty name="AtkObject::accessible_name" translatable="yes">Hexadecimal digit A</atkproperty>
 	      </accessibility>
 	      <signal name="clicked" handler="button_cb"/>
+	      <accelerator key="a" modifiers="0" signal="activate"/>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">0</property>
@@ -4893,13 +4891,13 @@
 	    <widget class="GtkButton" id="calc_pow_e_button">
 	      <property name="visible">True</property>
 	      <property name="tooltip" translatable="yes">e to the power of displayed value [{]</property>
-	      <property name="can_focus">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
+	      <property name="focus_on_click">False</property>
 	      <accessibility>
 		<atkproperty name="AtkObject::accessible_name" translatable="yes">E to the x</atkproperty>
 	      </accessibility>
 	      <signal name="clicked" handler="button_cb"/>
+	      <accelerator key="braceleft" modifiers="GDK_SHIFT_MASK" signal="activate"/>
 
 	      <child>
 		<widget class="GtkLabel" id="label11">
@@ -4939,14 +4937,14 @@
 	    <widget class="GtkButton" id="calc_factorial_button">
 	      <property name="visible">True</property>
 	      <property name="tooltip" translatable="yes">Factorial of displayed value [!]</property>
-	      <property name="can_focus">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
+	      <property name="focus_on_click">False</property>
 	      <accessibility>
 		<atkproperty name="AtkObject::accessible_name" translatable="yes">Factorial</atkproperty>
 		<atkproperty name="AtkObject::accessible_description" translatable="yes">Factorial</atkproperty>
 	      </accessibility>
 	      <signal name="clicked" handler="button_cb"/>
+	      <accelerator key="exclam" modifiers="GDK_SHIFT_MASK" signal="activate"/>
 
 	      <child>
 		<widget class="GtkLabel" id="label14">
@@ -4986,13 +4984,14 @@
 	    <widget class="GtkButton" id="calc_x_pow_y_button">
 	      <property name="visible">True</property>
 	      <property name="tooltip" translatable="yes">Raise displayed value to the power of y [^]</property>
-	      <property name="can_focus">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
+	      <property name="focus_on_click">False</property>
 	      <accessibility>
 		<atkproperty name="AtkObject::accessible_name" translatable="yes">X to the y</atkproperty>
 	      </accessibility>
 	      <signal name="clicked" handler="button_cb"/>
+	      <accelerator key="caret" modifiers="GDK_SHIFT_MASK" signal="activate"/>
+	      <accelerator key="asciicircum" modifiers="GDK_SHIFT_MASK" signal="activate"/>
 
 	      <child>
 		<widget class="GtkLabel" id="label13">
@@ -5032,13 +5031,13 @@
 	    <widget class="GtkButton" id="calc_pow_10_button">
 	      <property name="visible">True</property>
 	      <property name="tooltip" translatable="yes">10 to the power of displayed value [}]</property>
-	      <property name="can_focus">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
-	      <property name="focus_on_click">True</property>
+	      <property name="focus_on_click">False</property>
 	      <accessibility>
 		<atkproperty name="AtkObject::accessible_name" translatable="yes">10 to the x</atkproperty>
 	      </accessibility>
 	      <signal name="clicked" handler="button_cb"/>
+	      <accelerator key="braceright" modifiers="GDK_SHIFT_MASK" signal="activate"/>
 
 	      <child>
 		<widget class="GtkLabel" id="label12">
@@ -5104,15 +5103,15 @@
 		<widget class="GtkButton" id="calc_backspace_simple_button">
 		  <property name="visible">True</property>
 		  <property name="tooltip" translatable="yes">Remove rightmost character from displayed value</property>
-		  <property name="can_focus">True</property>
 		  <property name="label" translatable="yes" comments="Bksp is short for Backspace">Bksp</property>
 		  <property name="use_underline">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
+		  <property name="focus_on_click">False</property>
 		  <accessibility>
 		    <atkproperty name="AtkObject::accessible_name" translatable="yes">Backspace</atkproperty>
 		  </accessibility>
 		  <signal name="clicked" handler="button_cb"/>
+		  <accelerator key="BackSpace" modifiers="0" signal="activate"/>
 		</widget>
 		<packing>
 		  <property name="left_attach">0</property>
@@ -5128,15 +5127,15 @@
 		<widget class="GtkButton" id="calc_change_sign_simple_button">
 		  <property name="visible">True</property>
 		  <property name="tooltip" translatable="yes">Change Sign [C]</property>
-		  <property name="can_focus">True</property>
 		  <property name="label" translatable="yes" comments="This is a plus-minus sign (+/-)">±</property>
 		  <property name="use_underline">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
+		  <property name="focus_on_click">False</property>
 		  <accessibility>
 		    <atkproperty name="AtkObject::accessible_name" translatable="yes">Change sign</atkproperty>
 		  </accessibility>
 		  <signal name="clicked" handler="button_cb"/>
+		  <accelerator key="C" modifiers="GDK_SHIFT_MASK" signal="activate"/>
 		</widget>
 		<packing>
 		  <property name="left_attach">3</property>
@@ -5152,15 +5151,15 @@
 		<widget class="GtkButton" id="calc_clear_simple_button">
 		  <property name="visible">True</property>
 		  <property name="tooltip" translatable="yes">Clear displayed value and any partial calculation</property>
-		  <property name="can_focus">True</property>
 		  <property name="label" translatable="yes" comments="Clr is short for Clear">Clr</property>
 		  <property name="use_underline">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
+		  <property name="focus_on_click">False</property>
 		  <accessibility>
 		    <atkproperty name="AtkObject::accessible_name" translatable="yes">Clear</atkproperty>
 		  </accessibility>
 		  <signal name="clicked" handler="button_cb"/>
+		  <accelerator key="Delete" modifiers="0" signal="activate"/>
 		</widget>
 		<packing>
 		  <property name="left_attach">2</property>
@@ -5176,16 +5175,17 @@
 		<widget class="GtkButton" id="calc_clear_entry_simple_button">
 		  <property name="visible">True</property>
 		  <property name="tooltip" translatable="yes">Clear displayed value</property>
-		  <property name="can_focus">True</property>
 		  <property name="label" translatable="yes">CE</property>
 		  <property name="use_underline">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
+		  <property name="focus_on_click">False</property>
 		  <accessibility>
 		    <atkproperty name="AtkObject::accessible_name" translatable="yes">Clear entry</atkproperty>
 		    <atkproperty name="AtkObject::accessible_description" translatable="yes">Clear</atkproperty>
 		  </accessibility>
 		  <signal name="clicked" handler="button_cb"/>
+		  <accelerator key="BackSpace" modifiers="GDK_CONTROL_MASK" signal="activate"/>
+		  <accelerator key="Escape" modifiers="0" signal="activate"/>
 		</widget>
 		<packing>
 		  <property name="left_attach">1</property>
@@ -5220,15 +5220,15 @@
 		<widget class="GtkButton" id="calc_start_group_button">
 		  <property name="visible">True</property>
 		  <property name="tooltip" translatable="yes">Start group of calculations</property>
-		  <property name="can_focus">True</property>
 		  <property name="label" translatable="yes" comments="Left bracket">(</property>
 		  <property name="use_underline">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
+		  <property name="focus_on_click">False</property>
 		  <accessibility>
 		    <atkproperty name="AtkObject::accessible_name" translatable="yes">Left bracket</atkproperty>
 		  </accessibility>
 		  <signal name="clicked" handler="button_cb"/>
+		  <accelerator key="parenleft" modifiers="GDK_SHIFT_MASK" signal="activate"/>
 		</widget>
 		<packing>
 		  <property name="left_attach">0</property>
@@ -5244,13 +5244,13 @@
 		<widget class="GtkButton" id="calc_reciprocal_button">
 		  <property name="visible">True</property>
 		  <property name="tooltip" translatable="yes">Reciprocal [r]</property>
-		  <property name="can_focus">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
+		  <property name="focus_on_click">False</property>
 		  <accessibility>
 		    <atkproperty name="AtkObject::accessible_name" translatable="yes">Reciprocal</atkproperty>
 		  </accessibility>
 		  <signal name="clicked" handler="button_cb"/>
+		  <accelerator key="r" modifiers="0" signal="activate"/>
 
 		  <child>
 		    <widget class="GtkLabel" id="label20">
@@ -5290,15 +5290,15 @@
 		<widget class="GtkButton" id="calc_percentage_button">
 		  <property name="visible">True</property>
 		  <property name="tooltip" translatable="yes">Percentage</property>
-		  <property name="can_focus">True</property>
 		  <property name="label" translatable="yes" comments="This is a percentage sign">%</property>
 		  <property name="use_underline">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
+		  <property name="focus_on_click">False</property>
 		  <accessibility>
 		    <atkproperty name="AtkObject::accessible_name" translatable="yes">Percentage</atkproperty>
 		  </accessibility>
 		  <signal name="clicked" handler="button_cb"/>
+		  <accelerator key="percent" modifiers="GDK_SHIFT_MASK" signal="activate"/>
 		</widget>
 		<packing>
 		  <property name="left_attach">0</property>
@@ -5314,15 +5314,15 @@
 		<widget class="GtkButton" id="calc_end_group_button">
 		  <property name="visible">True</property>
 		  <property name="tooltip" translatable="yes">End group of calculations</property>
-		  <property name="can_focus">True</property>
 		  <property name="label" translatable="yes" comments="Right bracket">)</property>
 		  <property name="use_underline">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
+		  <property name="focus_on_click">False</property>
 		  <accessibility>
 		    <atkproperty name="AtkObject::accessible_name" translatable="yes">Right bracket</atkproperty>
 		  </accessibility>
 		  <signal name="clicked" handler="button_cb"/>
+		  <accelerator key="parenright" modifiers="GDK_SHIFT_MASK" signal="activate"/>
 		</widget>
 		<packing>
 		  <property name="left_attach">0</property>
@@ -5338,15 +5338,15 @@
 		<widget class="GtkButton" id="calc_backspace_advanced_button">
 		  <property name="visible">True</property>
 		  <property name="tooltip" translatable="yes">Remove rightmost character from displayed value</property>
-		  <property name="can_focus">True</property>
 		  <property name="label" translatable="yes" comments="Bksp is short for Backspace">Bksp</property>
 		  <property name="use_underline">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
+		  <property name="focus_on_click">False</property>
 		  <accessibility>
 		    <atkproperty name="AtkObject::accessible_name" translatable="yes">Backspace</atkproperty>
 		  </accessibility>
 		  <signal name="clicked" handler="button_cb"/>
+		  <accelerator key="BackSpace" modifiers="0" signal="activate"/>
 		</widget>
 		<packing>
 		  <property name="left_attach">1</property>
@@ -5362,15 +5362,15 @@
 		<widget class="GtkButton" id="calc_change_sign_advanced_button">
 		  <property name="visible">True</property>
 		  <property name="tooltip" translatable="yes">Change Sign [C]</property>
-		  <property name="can_focus">True</property>
 		  <property name="label" translatable="yes" comments="This is a plus-minus sign (+/-)">±</property>
 		  <property name="use_underline">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
+		  <property name="focus_on_click">False</property>
 		  <accessibility>
 		    <atkproperty name="AtkObject::accessible_name" translatable="yes">Change sign</atkproperty>
 		  </accessibility>
 		  <signal name="clicked" handler="button_cb"/>
+		  <accelerator key="C" modifiers="GDK_SHIFT_MASK" signal="activate"/>
 		</widget>
 		<packing>
 		  <property name="left_attach">1</property>
@@ -5386,16 +5386,16 @@
 		<widget class="GtkButton" id="calc_sqrt_button">
 		  <property name="visible">True</property>
 		  <property name="tooltip" translatable="yes">Square root [s]</property>
-		  <property name="can_focus">True</property>
 		  <property name="label" translatable="yes" comments="This is a square root sign">√</property>
 		  <property name="use_underline">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
+		  <property name="focus_on_click">False</property>
 		  <accessibility>
 		    <atkproperty name="AtkObject::accessible_name" translatable="yes">Square root</atkproperty>
 		    <atkproperty name="AtkObject::accessible_description" translatable="yes">Square root [s]</atkproperty>
 		  </accessibility>
 		  <signal name="clicked" handler="button_cb"/>
+		  <accelerator key="s" modifiers="0" signal="activate"/>
 		</widget>
 		<packing>
 		  <property name="left_attach">1</property>
@@ -5411,15 +5411,15 @@
 		<widget class="GtkButton" id="calc_abs_button">
 		  <property name="visible">True</property>
 		  <property name="tooltip" translatable="yes">Absolute value [u]</property>
-		  <property name="can_focus">True</property>
 		  <property name="label" translatable="yes" comments="Abs is short for Absolute">Abs</property>
 		  <property name="use_underline">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
+		  <property name="focus_on_click">False</property>
 		  <accessibility>
 		    <atkproperty name="AtkObject::accessible_name" translatable="yes">Absolute value</atkproperty>
 		  </accessibility>
 		  <signal name="clicked" handler="button_cb"/>
+		  <accelerator key="u" modifiers="0" signal="activate"/>
 		</widget>
 		<packing>
 		  <property name="left_attach">2</property>
@@ -5435,15 +5435,15 @@
 		<widget class="GtkButton" id="calc_fractional_portion_button">
 		  <property name="visible">True</property>
 		  <property name="tooltip" translatable="yes">Fractional portion of displayed value [:]</property>
-		  <property name="can_focus">True</property>
 		  <property name="label" translatable="yes" comments="Fractional portion">Frac</property>
 		  <property name="use_underline">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
+		  <property name="focus_on_click">False</property>
 		  <accessibility>
 		    <atkproperty name="AtkObject::accessible_name" translatable="yes">Fractional portion</atkproperty>
 		  </accessibility>
 		  <signal name="clicked" handler="button_cb"/>
+		  <accelerator key="colon" modifiers="GDK_SHIFT_MASK" signal="activate"/>
 		</widget>
 		<packing>
 		  <property name="left_attach">2</property>
@@ -5459,15 +5459,15 @@
 		<widget class="GtkButton" id="calc_integer_portion_button">
 		  <property name="visible">True</property>
 		  <property name="tooltip" translatable="yes">Integer portion of displayed value [i]</property>
-		  <property name="can_focus">True</property>
 		  <property name="label" translatable="yes" comments="Integer portion">Int</property>
 		  <property name="use_underline">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
+		  <property name="focus_on_click">False</property>
 		  <accessibility>
 		    <atkproperty name="AtkObject::accessible_name" translatable="yes">Integer portion</atkproperty>
 		  </accessibility>
 		  <signal name="clicked" handler="button_cb"/>
+		  <accelerator key="i" modifiers="0" signal="activate"/>
 		</widget>
 		<packing>
 		  <property name="left_attach">2</property>
@@ -5483,15 +5483,16 @@
 		<widget class="GtkButton" id="calc_clear_entry_advanced_button">
 		  <property name="visible">True</property>
 		  <property name="tooltip" translatable="yes">Clear displayed value</property>
-		  <property name="can_focus">True</property>
 		  <property name="label" translatable="yes">CE</property>
 		  <property name="use_underline">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
+		  <property name="focus_on_click">False</property>
 		  <accessibility>
 		    <atkproperty name="AtkObject::accessible_name" translatable="yes">Clear entry</atkproperty>
 		  </accessibility>
 		  <signal name="clicked" handler="button_cb"/>
+		  <accelerator key="BackSpace" modifiers="GDK_CONTROL_MASK" signal="activate"/>
+		  <accelerator key="Escape" modifiers="0" signal="activate"/>
 		</widget>
 		<packing>
 		  <property name="left_attach">2</property>
@@ -5507,14 +5508,14 @@
 		<widget class="GtkButton" id="calc_exchange_button">
 		  <property name="visible">True</property>
 		  <property name="tooltip" translatable="yes">Exchange displayed value with memory register [X]</property>
-		  <property name="can_focus">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
+		  <property name="focus_on_click">False</property>
 		  <accessibility>
 		    <atkproperty name="AtkObject::accessible_name" translatable="yes">Exchange with register</atkproperty>
 		  </accessibility>
 		  <signal name="clicked" handler="menu_button_button_press_cb"/>
 		  <signal name="key-press-event" handler="menu_button_key_press_cb"/>
+		  <accelerator key="X" modifiers="GDK_SHIFT_MASK" signal="activate"/>
 
 		  <child>
 		    <widget class="GtkHBox" id="hbox18">
@@ -5584,14 +5585,14 @@
 		<widget class="GtkButton" id="calc_recall_button">
 		  <property name="visible">True</property>
 		  <property name="tooltip" translatable="yes">Retrieve memory register to display [R]</property>
-		  <property name="can_focus">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
+		  <property name="focus_on_click">False</property>
 		  <accessibility>
 		    <atkproperty name="AtkObject::accessible_name" translatable="yes">Retreive from register</atkproperty>
 		  </accessibility>
 		  <signal name="clicked" handler="menu_button_button_press_cb"/>
 		  <signal name="key-press-event" handler="menu_button_key_press_cb"/>
+		  <accelerator key="R" modifiers="GDK_SHIFT_MASK" signal="activate"/>
 
 		  <child>
 		    <widget class="GtkHBox" id="hbox19">
@@ -5661,15 +5662,15 @@
 		<widget class="GtkButton" id="calc_clear_advanced_button">
 		  <property name="visible">True</property>
 		  <property name="tooltip" translatable="yes">Clear displayed value and any partial calculation</property>
-		  <property name="can_focus">True</property>
 		  <property name="label" translatable="yes" comments="Clr is short for Clear">Clr</property>
 		  <property name="use_underline">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
+		  <property name="focus_on_click">False</property>
 		  <accessibility>
 		    <atkproperty name="AtkObject::accessible_name" translatable="yes">Clear</atkproperty>
 		  </accessibility>
 		  <signal name="clicked" handler="button_cb"/>
+		  <accelerator key="Delete" modifiers="0" signal="activate"/>
 		</widget>
 		<packing>
 		  <property name="left_attach">3</property>
@@ -5685,14 +5686,14 @@
 		<widget class="GtkButton" id="calc_store_button">
 		  <property name="visible">True</property>
 		  <property name="tooltip" translatable="yes">Store displayed value in memory register [S]</property>
-		  <property name="can_focus">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
+		  <property name="focus_on_click">False</property>
 		  <accessibility>
 		    <atkproperty name="AtkObject::accessible_name" translatable="yes">Store to register</atkproperty>
 		  </accessibility>
 		  <signal name="clicked" handler="menu_button_button_press_cb"/>
 		  <signal name="key-press-event" handler="menu_button_key_press_cb"/>
+		  <accelerator key="S" modifiers="GDK_SHIFT_MASK" signal="activate"/>
 
 		  <child>
 		    <widget class="GtkHBox" id="hbox20">
@@ -5762,13 +5763,13 @@
 		<widget class="GtkButton" id="calc_square_button">
 		  <property name="visible">True</property>
 		  <property name="tooltip" translatable="yes">Square [@]</property>
-		  <property name="can_focus">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
+		  <property name="focus_on_click">False</property>
 		  <accessibility>
 		    <atkproperty name="AtkObject::accessible_name" translatable="yes">Square</atkproperty>
 		  </accessibility>
 		  <signal name="clicked" handler="button_cb"/>
+		  <accelerator key="at" modifiers="GDK_SHIFT_MASK" signal="activate"/>
 
 		  <child>
 		    <widget class="GtkLabel" id="label24">
@@ -5826,15 +5827,18 @@
 	      <child>
 		<widget class="GtkButton" id="calc_4_button">
 		  <property name="visible">True</property>
-		  <property name="can_focus">True</property>
 		  <property name="label" translatable="yes" comments="Numeric 4">4</property>
 		  <property name="use_underline">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
+		  <property name="focus_on_click">False</property>
 		  <accessibility>
 		    <atkproperty name="AtkObject::accessible_name" translatable="yes">Numeric 4</atkproperty>
 		  </accessibility>
 		  <signal name="clicked" handler="button_cb"/>
+		  <accelerator key="4" modifiers="0" signal="activate"/>
+		  <accelerator key="4" modifiers="GDK_SHIFT_MASK" signal="activate"/>
+		  <accelerator key="KP_4" modifiers="0" signal="activate"/>
+		  <accelerator key="KP_Left" modifiers="0" signal="activate"/>
 		</widget>
 		<packing>
 		  <property name="left_attach">0</property>
@@ -5849,15 +5853,18 @@
 	      <child>
 		<widget class="GtkButton" id="calc_7_button">
 		  <property name="visible">True</property>
-		  <property name="can_focus">True</property>
 		  <property name="label" translatable="yes" comments="Numeric 7">7</property>
 		  <property name="use_underline">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
+		  <property name="focus_on_click">False</property>
 		  <accessibility>
 		    <atkproperty name="AtkObject::accessible_name" translatable="yes">Numeric 7</atkproperty>
 		  </accessibility>
 		  <signal name="clicked" handler="button_cb"/>
+		  <accelerator key="7" modifiers="0" signal="activate"/>
+		  <accelerator key="7" modifiers="GDK_SHIFT_MASK" signal="activate"/>
+		  <accelerator key="KP_7" modifiers="0" signal="activate"/>
+		  <accelerator key="KP_Home" modifiers="0" signal="activate"/>
 		</widget>
 		<packing>
 		  <property name="left_attach">0</property>
@@ -5872,15 +5879,18 @@
 	      <child>
 		<widget class="GtkButton" id="calc_8_button">
 		  <property name="visible">True</property>
-		  <property name="can_focus">True</property>
 		  <property name="label" translatable="yes" comments="Numeric 8">8</property>
 		  <property name="use_underline">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
+		  <property name="focus_on_click">False</property>
 		  <accessibility>
 		    <atkproperty name="AtkObject::accessible_name" translatable="yes">Numeric 8</atkproperty>
 		  </accessibility>
 		  <signal name="clicked" handler="button_cb"/>
+		  <accelerator key="8" modifiers="0" signal="activate"/>
+		  <accelerator key="8" modifiers="GDK_SHIFT_MASK" signal="activate"/>
+		  <accelerator key="KP_8" modifiers="0" signal="activate"/>
+		  <accelerator key="KP_Up" modifiers="0" signal="activate"/>
 		</widget>
 		<packing>
 		  <property name="left_attach">1</property>
@@ -5895,15 +5905,18 @@
 	      <child>
 		<widget class="GtkButton" id="calc_9_button">
 		  <property name="visible">True</property>
-		  <property name="can_focus">True</property>
 		  <property name="label" translatable="yes" comments="Numeric 9">9</property>
 		  <property name="use_underline">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
+		  <property name="focus_on_click">False</property>
 		  <accessibility>
 		    <atkproperty name="AtkObject::accessible_name" translatable="yes">Numeric 9</atkproperty>
 		  </accessibility>
 		  <signal name="clicked" handler="button_cb"/>
+		  <accelerator key="9" modifiers="0" signal="activate"/>
+		  <accelerator key="9" modifiers="GDK_SHIFT_MASK" signal="activate"/>
+		  <accelerator key="KP_9" modifiers="0" signal="activate"/>
+		  <accelerator key="KP_Page_Up" modifiers="0" signal="activate"/>
 		</widget>
 		<packing>
 		  <property name="left_attach">2</property>
@@ -5918,15 +5931,18 @@
 	      <child>
 		<widget class="GtkButton" id="calc_5_button">
 		  <property name="visible">True</property>
-		  <property name="can_focus">True</property>
 		  <property name="label" translatable="yes" comments="Numeric 5">5</property>
 		  <property name="use_underline">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
+		  <property name="focus_on_click">False</property>
 		  <accessibility>
 		    <atkproperty name="AtkObject::accessible_name" translatable="yes">Numeric 5</atkproperty>
 		  </accessibility>
 		  <signal name="clicked" handler="button_cb"/>
+		  <accelerator key="5" modifiers="0" signal="activate"/>
+		  <accelerator key="5" modifiers="GDK_SHIFT_MASK" signal="activate"/>
+		  <accelerator key="KP_5" modifiers="0" signal="activate"/>
+		  <accelerator key="KP_Begin" modifiers="0" signal="activate"/>
 		</widget>
 		<packing>
 		  <property name="left_attach">1</property>
@@ -5941,15 +5957,18 @@
 	      <child>
 		<widget class="GtkButton" id="calc_6_button">
 		  <property name="visible">True</property>
-		  <property name="can_focus">True</property>
 		  <property name="label" translatable="yes" comments="Numeric 6">6</property>
 		  <property name="use_underline">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
+		  <property name="focus_on_click">False</property>
 		  <accessibility>
 		    <atkproperty name="AtkObject::accessible_name" translatable="yes">Numeric 6</atkproperty>
 		  </accessibility>
 		  <signal name="clicked" handler="button_cb"/>
+		  <accelerator key="6" modifiers="0" signal="activate"/>
+		  <accelerator key="6" modifiers="GDK_SHIFT_MASK" signal="activate"/>
+		  <accelerator key="KP_6" modifiers="0" signal="activate"/>
+		  <accelerator key="KP_Right" modifiers="0" signal="activate"/>
 		</widget>
 		<packing>
 		  <property name="left_attach">2</property>
@@ -5965,15 +5984,17 @@
 		<widget class="GtkButton" id="calc_divide_button">
 		  <property name="visible">True</property>
 		  <property name="tooltip" translatable="yes">Divide</property>
-		  <property name="can_focus">True</property>
 		  <property name="label" translatable="yes" comments="this is a division sign (÷)">÷</property>
 		  <property name="use_underline">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
+		  <property name="focus_on_click">False</property>
 		  <accessibility>
 		    <atkproperty name="AtkObject::accessible_name" translatable="yes">Divide</atkproperty>
 		  </accessibility>
 		  <signal name="clicked" handler="button_cb"/>
+  		  <accelerator key="slash" modifiers="0" signal="activate"/>
+  		  <accelerator key="slash" modifiers="GDK_SHIFT_MASK" signal="activate"/>
+		  <accelerator key="KP_Divide" modifiers="0" signal="activate"/>
 		</widget>
 		<packing>
 		  <property name="left_attach">3</property>
@@ -5988,15 +6009,18 @@
 	      <child>
 		<widget class="GtkButton" id="calc_1_button">
 		  <property name="visible">True</property>
-		  <property name="can_focus">True</property>
 		  <property name="label" translatable="yes" comments="Numeric 1">1</property>
 		  <property name="use_underline">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
+		  <property name="focus_on_click">False</property>
 		  <accessibility>
 		    <atkproperty name="AtkObject::accessible_name" translatable="yes">Numeric 1</atkproperty>
 		  </accessibility>
 		  <signal name="clicked" handler="button_cb"/>
+ 		  <accelerator key="1" modifiers="0" signal="activate"/>
+		  <accelerator key="1" modifiers="GDK_SHIFT_MASK" signal="activate"/>
+		  <accelerator key="KP_1" modifiers="0" signal="activate"/>
+		  <accelerator key="KP_End" modifiers="0" signal="activate"/>
 		</widget>
 		<packing>
 		  <property name="left_attach">0</property>
@@ -6011,15 +6035,18 @@
 	      <child>
 		<widget class="GtkButton" id="calc_2_button">
 		  <property name="visible">True</property>
-		  <property name="can_focus">True</property>
 		  <property name="label" translatable="yes" comments="Numeric 2">2</property>
 		  <property name="use_underline">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
+		  <property name="focus_on_click">False</property>
 		  <accessibility>
 		    <atkproperty name="AtkObject::accessible_name" translatable="yes">Numeric 2</atkproperty>
 		  </accessibility>
 		  <signal name="clicked" handler="button_cb"/>
+  		  <accelerator key="2" modifiers="0" signal="activate"/>
+		  <accelerator key="2" modifiers="GDK_SHIFT_MASK" signal="activate"/>
+		  <accelerator key="KP_2" modifiers="0" signal="activate"/>
+		  <accelerator key="KP_Down" modifiers="0" signal="activate"/>
 		</widget>
 		<packing>
 		  <property name="left_attach">1</property>
@@ -6034,15 +6061,18 @@
 	      <child>
 		<widget class="GtkButton" id="calc_0_button">
 		  <property name="visible">True</property>
-		  <property name="can_focus">True</property>
 		  <property name="label" translatable="yes" comments="Numeric 0">0</property>
 		  <property name="use_underline">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
+		  <property name="focus_on_click">False</property>
 		  <accessibility>
 		    <atkproperty name="AtkObject::accessible_name" translatable="yes">Numeric 0</atkproperty>
 		  </accessibility>
 		  <signal name="clicked" handler="button_cb"/>
+		  <accelerator key="0" modifiers="0" signal="activate"/>
+		  <accelerator key="0" modifiers="GDK_SHIFT_MASK" signal="activate"/>
+		  <accelerator key="KP_0" modifiers="0" signal="activate"/>
+		  <accelerator key="KP_Insert" modifiers="0" signal="activate"/>
 		</widget>
 		<packing>
 		  <property name="left_attach">0</property>
@@ -6058,15 +6088,18 @@
 		<widget class="GtkButton" id="calc_numeric_point_button">
 		  <property name="visible">True</property>
 		  <property name="tooltip" translatable="yes">Numeric point</property>
-		  <property name="can_focus">True</property>
 		  <property name="label" translatable="yes" comments="Numeric point">.</property>
 		  <property name="use_underline">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
+		  <property name="focus_on_click">False</property>
 		  <accessibility>
 		    <atkproperty name="AtkObject::accessible_name" translatable="yes">Numeric point</atkproperty>
 		  </accessibility>
 		  <signal name="clicked" handler="button_cb"/>
+		  <accelerator key="period" modifiers="0" signal="activate"/>
+		  <accelerator key="KP_Decimal" modifiers="0" signal="activate"/>
+		  <accelerator key="KP_Delete" modifiers="0" signal="activate"/>
+		  <accelerator key="KP_Separator" modifiers="0" signal="activate"/>
 		</widget>
 		<packing>
 		  <property name="left_attach">1</property>
@@ -6082,15 +6115,18 @@
 		<widget class="GtkButton" id="calc_result_button">
 		  <property name="visible">True</property>
 		  <property name="tooltip" translatable="yes">Calculate result</property>
-		  <property name="can_focus">True</property>
 		  <property name="label" translatable="yes" comments="This is the calculate result button (=)">=</property>
 		  <property name="use_underline">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
+		  <property name="focus_on_click">False</property>
 		  <accessibility>
 		    <atkproperty name="AtkObject::accessible_name" translatable="yes">Calculate result</atkproperty>
 		  </accessibility>
 		  <signal name="clicked" handler="button_cb"/>
+		  <accelerator key="KP_Enter" modifiers="0" signal="activate"/>
+		  <accelerator key="Return" modifiers="0" signal="activate"/>
+		  <accelerator key="equal" modifiers="0" signal="activate"/>
+		  <accelerator key="equal" modifiers="GDK_SHIFT_MASK" signal="activate"/>
 		</widget>
 		<packing>
 		  <property name="left_attach">2</property>
@@ -6105,15 +6141,18 @@
 	      <child>
 		<widget class="GtkButton" id="calc_3_button">
 		  <property name="visible">True</property>
-		  <property name="can_focus">True</property>
 		  <property name="label" translatable="yes" comments="Numeric 3">3</property>
 		  <property name="use_underline">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
+		  <property name="focus_on_click">False</property>
 		  <accessibility>
 		    <atkproperty name="AtkObject::accessible_name" translatable="yes">Numeric 3</atkproperty>
 		  </accessibility>
 		  <signal name="clicked" handler="button_cb"/>
+		  <accelerator key="3" modifiers="0" signal="activate"/>
+		  <accelerator key="3" modifiers="GDK_SHIFT_MASK" signal="activate"/>
+		  <accelerator key="KP_3" modifiers="0" signal="activate"/>
+		  <accelerator key="KP_Page_Down" modifiers="0" signal="activate"/>
 		</widget>
 		<packing>
 		  <property name="left_attach">2</property>
@@ -6129,16 +6168,18 @@
 		<widget class="GtkButton" id="calc_multiply_button">
 		  <property name="visible">True</property>
 		  <property name="tooltip" translatable="yes">Multiply</property>
-		  <property name="can_focus">True</property>
 		  <property name="label" translatable="yes" comments="This is a multiplication sign (*)">×</property>
 		  <property name="use_underline">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
+		  <property name="focus_on_click">False</property>
 		  <accessibility>
 		    <atkproperty name="AtkObject::accessible_name" translatable="yes">Multiply</atkproperty>
 		    <atkproperty name="AtkObject::accessible_description" translatable="yes">Multiply</atkproperty>
 		  </accessibility>
 		  <signal name="clicked" handler="button_cb"/>
+		  <accelerator key="asterisk" modifiers="GDK_SHIFT_MASK" signal="activate"/>
+		  <accelerator key="KP_Multiply" modifiers="0" signal="activate"/>
+		  <accelerator key="x" modifiers="0" signal="activate"/>
 		</widget>
 		<packing>
 		  <property name="left_attach">3</property>
@@ -6154,16 +6195,18 @@
 		<widget class="GtkButton" id="calc_subtract_button">
 		  <property name="visible">True</property>
 		  <property name="tooltip" translatable="yes">Subtract</property>
-		  <property name="can_focus">True</property>
 		  <property name="label" translatable="yes" comments="This is a minus sign (-)">−</property>
 		  <property name="use_underline">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
+		  <property name="focus_on_click">False</property>
 		  <accessibility>
 		    <atkproperty name="AtkObject::accessible_name" translatable="yes">Subtract</atkproperty>
 		    <atkproperty name="AtkObject::accessible_description" translatable="yes">Subtract</atkproperty>
 		  </accessibility>
 		  <signal name="clicked" handler="button_cb"/>
+		  <accelerator key="minus" modifiers="0" signal="activate"/>
+		  <accelerator key="minus" modifiers="GDK_SHIFT_MASK" signal="activate"/>
+		  <accelerator key="KP_Subtract" modifiers="0" signal="activate"/>
 		</widget>
 		<packing>
 		  <property name="left_attach">3</property>
@@ -6179,15 +6222,17 @@
 		<widget class="GtkButton" id="calc_add_button">
 		  <property name="visible">True</property>
 		  <property name="tooltip" translatable="yes">Add</property>
-		  <property name="can_focus">True</property>
 		  <property name="label" translatable="yes">+</property>
 		  <property name="use_underline">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
+		  <property name="focus_on_click">False</property>
 		  <accessibility>
 		    <atkproperty name="AtkObject::accessible_name" translatable="yes">Add</atkproperty>
 		  </accessibility>
 		  <signal name="clicked" handler="button_cb"/>
+		  <accelerator key="plus" modifiers="0" signal="activate"/>
+		  <accelerator key="plus" modifiers="GDK_SHIFT_MASK" signal="activate"/>
+		  <accelerator key="KP_Add" modifiers="0" signal="activate"/>
 		</widget>
 		<packing>
 		  <property name="left_attach">3</property>
