? env.sh
? buildit.ksh
? gcalctool/display
Index: gcalctool/calctool.c
===================================================================
RCS file: /cvs/gnome/gcalctool/gcalctool/calctool.c,v
retrieving revision 1.38
diff -u -r1.38 calctool.c
--- gcalctool/calctool.c	15 Apr 2003 20:02:29 -0000	1.38
+++ gcalctool/calctool.c	24 Apr 2003 20:51:31 -0000
@@ -24,6 +24,7 @@
 #include <malloc.h>
 #include <sys/types.h>
 #include "calctool.h"
+#include <gdk/gdkkeysyms.h>
 
 time_t time();
 
@@ -135,8 +136,8 @@
 {
     N_("7"),
     N_("Numeric 7"),
-    CALC_MOD_NONE,
-    CALC_KEY_7,
+    { 0,     0,        0,           0 },
+    { GDK_7, GDK_KP_7, GDK_KP_Home, 0 },
     '7',
     M_NONE,
     do_number
@@ -144,8 +145,8 @@
 {
     N_("8"),
     N_("Numeric 8"),
-    CALC_MOD_NONE,
-    CALC_KEY_8,
+    { 0,     0,        0,         0 },
+    { GDK_8, GDK_KP_8, GDK_KP_Up, 0 },
     '8',
     M_NONE,
     do_number
@@ -153,8 +154,8 @@
 {
     N_("9"),
     N_("Numeric 9"),
-    CALC_MOD_NONE,
-    CALC_KEY_9,
+    { 0,     0,        0,            0,              0 },
+    { GDK_9, GDK_KP_9, GDK_KP_Prior, GDK_KP_Page_Up, 0 },
     '9',
     M_NONE,
     do_number
@@ -162,8 +163,8 @@
 {    
     N_("/"),
     N_("Divide"),
-    CALC_MOD_NONE,
-    CALC_KEY_DIV,
+    { 0,         0,             0 },
+    { GDK_slash, GDK_KP_Divide, 0 },
     '/',
     M_NONE,
     do_calc
@@ -171,8 +172,8 @@
 {
     "    ",
     "    ",
-    CALC_MOD_NONE,
-    CALC_KEY_NONE,
+    { 0, 0 },
+    { 0, 0 },
     ' ',
     M_NONE,
     do_none
@@ -180,8 +181,8 @@
 {
     N_("Bsp"),
     N_("Remove rightmost character from displayed value"),
-    CALC_MOD_NONE,
-    CALC_KEY_BSP,
+    { 0, 0 },
+    { GDK_BackSpace, 0 },
     '\010',
     M_NONE,
     do_delete
@@ -189,8 +190,8 @@
 {
     N_("CE"),
     N_("Clear displayed value"),
-    CALC_MOD_CONTROL_MASK,
-    CALC_KEY_CE,
+    { GDK_CONTROL_MASK, 0 },
+    { GDK_BackSpace, 0 },
     '\013',
     M_NONE,
     do_clear_entry
@@ -198,8 +199,8 @@
 {
     N_("Clr"),
     N_("Clear displayed value and any partial calculation"),
-    CALC_MOD_NONE,
-    CALC_KEY_CLR,
+    { 0, 0 },
+    { GDK_Delete, 0 },
     '\177',
     M_NONE,
     do_clear
@@ -209,8 +210,8 @@
 {
     N_("4"),
     N_("Numeric 4"),
-    CALC_MOD_NONE,
-    CALC_KEY_4,
+    { 0,     0,        0,           0 },
+    { GDK_4, GDK_KP_4, GDK_KP_Left, 0 },
     '4',
     M_NONE,
     do_number
@@ -218,8 +219,8 @@
 {
     N_("5"),
     N_("Numeric 5"),
-    CALC_MOD_NONE,
-    CALC_KEY_5,
+    { 0,     0,        0,            0 },
+    { GDK_5, GDK_KP_5, GDK_KP_Begin, 0 },
     '5',
     M_NONE,
     do_number
@@ -227,8 +228,8 @@
 {
     N_("6"),
     N_("Numeric 6"),
-    CALC_MOD_NONE,
-    CALC_KEY_6,
+    { 0,     0,        0,            0 },
+    { GDK_6, GDK_KP_6, GDK_KP_Right, 0 },
     '6',
     M_NONE,
     do_number
@@ -236,8 +237,8 @@
 {
     N_("*"),
     N_("Multiply"),
-    CALC_MOD_NONE,
-    CALC_KEY_MUL,
+    { 0,            0,               0,     0 },
+    { GDK_asterisk, GDK_KP_Multiply, GDK_x, 0 },
     '*',
     M_NONE,
     do_calc
@@ -245,8 +246,8 @@
 {
     "    ",
     "    ",
-    CALC_MOD_NONE,
-    CALC_KEY_NONE,
+    { 0, 0 },
+    { 0, 0 },
     ' ',
     M_NONE,
     do_none
@@ -254,8 +255,8 @@
 {
     N_("+/-"),
     N_("Change sign"),
-    CALC_MOD_SHIFT_MASK,
-    CALC_KEY_CHS,
+    { GDK_SHIFT_MASK, 0 },
+    { GDK_C, 0 },
     'C',
     M_NONE,
     do_immed
@@ -263,8 +264,8 @@
 {
     N_("Int"),
     N_("Integer portion of displayed value"),
-    CALC_MOD_NONE,
-    CALC_KEY_INT,
+    { 0, 0 },
+    { GDK_i, 0 },
     'i',
     M_NONE,
     do_portion
@@ -272,8 +273,8 @@
 {
     N_("Sto"),
     N_("Store displayed value in memory register"),
-    CALC_MOD_SHIFT_MASK,
-    CALC_KEY_STO,
+    { GDK_SHIFT_MASK, 0 },
+    { GDK_S, 0 },
     'S',
     M_STO,
     do_pending
@@ -283,8 +284,8 @@
 {
     N_("1"),
     N_("Numeric 1"),
-    CALC_MOD_NONE,
-    CALC_KEY_1,
+    { 0,     0,        0,          0 },
+    { GDK_1, GDK_KP_1, GDK_KP_End, 0 },
     '1',
     M_NONE,
     do_number
@@ -292,8 +293,8 @@
 {
     N_("2"),
     N_("Numeric 2"),
-    CALC_MOD_NONE, 
-    CALC_KEY_2,
+    { 0,     0,        0,           0 }, 
+    { GDK_2, GDK_KP_2, GDK_KP_Down, 0 },
     '2',
     M_NONE,
     do_number
@@ -301,8 +302,8 @@
 {     
     N_("3"),
     N_("Numeric 3"),
-    CALC_MOD_NONE,
-    CALC_KEY_3,
+    { 0,     0,        0,           0,                0 },
+    { GDK_3, GDK_KP_3, GDK_KP_Next, GDK_KP_Page_Down, 0 },
     '3',
     M_NONE,
     do_number
@@ -310,8 +311,8 @@
 {
     N_("-"),
     N_("Subtract"),
-    CALC_MOD_NONE,
-    CALC_KEY_SUB,
+    { 0,         0,               0 },
+    { GDK_minus, GDK_KP_Subtract, 0 },
     '-',
     M_NONE,
     do_calc
@@ -319,8 +320,8 @@
 {
     N_("%"),
     N_("Percentage"),
-    CALC_MOD_SHIFT_MASK,
-    CALC_KEY_PER,
+    { GDK_SHIFT_MASK, 0 },
+    { GDK_percent, 0 },
     '%',
     M_NONE,
     do_calc
@@ -328,8 +329,8 @@
 {
     N_("Sqrt"),
     N_("Square root"),
-    CALC_MOD_NONE,   
-    CALC_KEY_SQRT,
+    { 0, 0 },   
+    { GDK_s, 0 },
     's',
     M_NONE,
     do_immed
@@ -337,8 +338,8 @@
 {
     N_("Frac"),
     N_("Fractional portion of displayed value"),
-    CALC_MOD_SHIFT_MASK,
-    CALC_KEY_FRAC,
+    { GDK_SHIFT_MASK, 0 },
+    { GDK_colon, 0 },
     ':',
     M_NONE,
     do_portion
@@ -346,8 +347,8 @@
 {
     N_("Rcl"),
     N_("Retrieve memory register to display"),
-    CALC_MOD_SHIFT_MASK,
-    CALC_KEY_RCL,
+    { GDK_SHIFT_MASK, 0 },
+    { GDK_R, 0 },
     'R',
     M_RCL,
     do_pending
@@ -357,8 +358,8 @@
 {
     N_("0"),
     N_("Numeric 0"),
-    CALC_MOD_NONE,
-    CALC_KEY_0,
+    { 0,     0,        0,             0 },
+    { GDK_0, GDK_KP_0, GDK_KP_Insert, 0 },
     '0',
     M_NONE,
     do_number
@@ -366,8 +367,8 @@
 {    
     N_("."),
     N_("Numeric point"),
-    CALC_MOD_NONE,
-    CALC_KEY_PNT,
+    { 0,          0,              0,             0 },
+    { GDK_period, GDK_KP_Decimal, GDK_KP_Delete, 0 },
     '.',
     M_NONE,
     do_point
@@ -375,8 +376,8 @@
 {
     N_("="),
     N_("Calculate result"),
-    CALC_MOD_NONE,
-    CALC_KEY_EQ,
+    { 0,         0,            0,          0 },
+    { GDK_equal, GDK_KP_Enter, GDK_Return, 0 },
     '=',
     M_NONE,
     do_calc
@@ -384,8 +385,8 @@
 {
     N_("+"),
     N_("Add"),
-    CALC_MOD_SHIFT_MASK,
-    CALC_KEY_ADD,
+    { GDK_SHIFT_MASK, 0,          0 },
+    { GDK_plus,       GDK_KP_Add, 0 },
     '+',
     M_NONE,
     do_calc
@@ -393,8 +394,8 @@
 {
     N_("1/x"),
     N_("Reciprocal"),
-    CALC_MOD_NONE,
-    CALC_KEY_REC,
+    { 0, 0 },
+    { GDK_r, 0 },
     'r',
     M_NONE,
     do_immed
@@ -402,8 +403,8 @@
 {
     N_("x<sup>2</sup>"),
     N_("Square"),
-    CALC_MOD_SHIFT_MASK,
-    CALC_KEY_SQR,
+    { GDK_SHIFT_MASK, 0 },
+    { GDK_at, 0 },
     '@',
     M_NONE,
     do_immed
@@ -411,8 +412,8 @@
 {
     N_("Abs"),
     N_("Absolute value"),
-    CALC_MOD_NONE,
-    CALC_KEY_ABS,
+    { 0, 0 },
+    { GDK_u, 0 },
     'u',
     M_NONE,
     do_portion
@@ -420,8 +421,8 @@
 {
     N_("Exch"),
     N_("Exchange displayed value with memory register"),
-    CALC_MOD_SHIFT_MASK,
-    CALC_KEY_EXCH,
+    { GDK_SHIFT_MASK, 0 },
+    { GDK_X, 0 },
     'X',
     M_EXCH,
     do_pending
@@ -444,8 +445,8 @@
 {
     N_("Ctrm"),
     N_("Compounding term"),
-    CALC_MOD_NONE,
-    CALC_KEY_CTRM,
+    { 0, 0 },
+    { GDK_m, 0 },
     'm',
     M_NONE,
     do_business
@@ -453,8 +454,8 @@
 {
     N_("Ddb"),
     N_("Double-declining depreciation"),
-    CALC_MOD_SHIFT_MASK,
-    CALC_KEY_DDB,
+    { GDK_SHIFT_MASK, 0 },
+    { GDK_D, 0 },
     'D',
     M_NONE,
     do_business
@@ -462,8 +463,8 @@
 {
     N_("Fv"),
     N_("Future value"),
-    CALC_MOD_NONE,
-    CALC_KEY_FV,
+    { 0, 0 },
+    { GDK_v, 0 },
     'v',
     M_NONE,
     do_business
@@ -471,8 +472,8 @@
 {
     N_("Pmt"),
     N_("Periodic payment"),
-    CALC_MOD_SHIFT_MASK,
-    CALC_KEY_PMT,
+    { GDK_SHIFT_MASK, 0 },
+    { GDK_P, 0 },
     'P',
     M_NONE,
     do_business
@@ -480,8 +481,8 @@
 {
     N_("Pv"),
     N_("Present value"),
-    CALC_MOD_NONE,
-    CALC_KEY_PV,
+    { 0, 0 },
+    { GDK_p, 0 },
     'p',
     M_NONE,
     do_business
@@ -489,8 +490,8 @@
 {
     N_("Rate"),
     N_("Periodic interest rate"),
-    CALC_MOD_SHIFT_MASK,
-    CALC_KEY_RATE,
+    { GDK_SHIFT_MASK, 0 },
+    { GDK_T, 0 },
     'T',
     M_NONE,
     do_business
@@ -498,8 +499,8 @@
 {
     N_("Sln"),
     N_("Straight-line depreciation"),
-    CALC_MOD_NONE,
-    CALC_KEY_SLN,
+    { 0, 0 },
+    { GDK_l, 0 },
     'l',
     M_NONE,
     do_business
@@ -507,8 +508,8 @@
 { 
     N_("Syd"),
     N_("Sum-of-the years'-digits depreciation"),
-    CALC_MOD_NONE,
-    CALC_KEY_SYD,
+    { 0, 0 },
+    { GDK_Y, 0 },
     'Y',
     M_NONE,
     do_business
@@ -518,8 +519,8 @@
 { 
     N_("Term"),
     N_("Payment period"),
-    CALC_MOD_NONE,
-    CALC_KEY_TERM,
+    { 0, 0 },
+    { GDK_T, 0 },
     'T',
     M_NONE,
     do_business
@@ -527,8 +528,8 @@
 { 
     "    ",
     "    ",
-    CALC_MOD_NONE,
-    CALC_KEY_NONE,
+    { 0, 0 },
+    { 0, 0 },
     ' ',
     M_NONE,
     do_none
@@ -536,8 +537,8 @@
 { 
     "    ",
     "    ",
-    CALC_MOD_NONE,
-    CALC_KEY_NONE,
+    { 0, 0 },
+    { 0, 0 },
     ' ',
     M_NONE,
     do_none
@@ -545,8 +546,8 @@
 { 
     "    ",
     "    ",
-    CALC_MOD_NONE,
-    CALC_KEY_NONE,
+    { 0, 0 },
+    { 0, 0 },
     ' ',
     M_NONE,
     do_none
@@ -554,8 +555,8 @@
 { 
     "    ",
     "    ",
-    CALC_MOD_NONE,
-    CALC_KEY_NONE,
+    { 0, 0 },
+    { 0, 0 },
     ' ',
     M_NONE,
     do_none
@@ -563,8 +564,8 @@
 { 
     "    ",
     "    ",
-    CALC_MOD_NONE,
-    CALC_KEY_NONE,
+    { 0, 0 },
+    { 0, 0 },
     ' ',
     M_NONE,
     do_none
@@ -572,8 +573,8 @@
 { 
     "    ",
     "    ",
-    CALC_MOD_NONE,
-    CALC_KEY_NONE,
+    { 0, 0 },
+    { 0, 0 },
     ' ',
     M_NONE,
     do_none
@@ -581,8 +582,8 @@
 {
     "    ",
     "    ",
-    CALC_MOD_NONE,
-    CALC_KEY_NONE,
+    { 0, 0 },
+    { 0, 0 },
     ' ',
     M_NONE,
     do_none
@@ -605,8 +606,8 @@
 {
     N_("<"),
     N_("Shift displayed value 1-15 places to the left"),
-    CALC_MOD_SHIFT_MASK,
-    CALC_KEY_LSFT,
+    { GDK_SHIFT_MASK, 0 },
+    { GDK_less, 0 },
     '<',
     M_LSHF,
     do_pending
@@ -614,8 +615,8 @@
 {
     N_(">"),
     N_("Shift displayed value 1-15 places to the right"),
-    CALC_MOD_SHIFT_MASK,
-    CALC_KEY_RSFT,
+    { GDK_SHIFT_MASK, 0 },
+    { GDK_greater, 0 },
     '>',
     M_RSHF,   
     do_pending
@@ -623,8 +624,8 @@
 {             
     N_("&amp;16"),
     N_("16-bit unsigned integer value of display"),
-    CALC_MOD_NONE,        
-    CALC_KEY_16,
+    { 0, 0 },        
+    { GDK_bracketright, 0 },
     ']',
     M_NONE,   
     do_immed  
@@ -632,8 +633,8 @@
 {             
     N_("&amp;32"),
     N_("32-bit unsigned integer value of display"),
-    CALC_MOD_NONE,
-    CALC_KEY_32,
+    { 0, 0 },
+    { GDK_bracketleft, 0 },
     '[',
     M_NONE,
     do_immed
@@ -641,8 +642,8 @@
 {
     "    ",
     "    ",
-    CALC_MOD_NONE,
-    CALC_KEY_NONE,
+    { 0, 0 },
+    { 0, 0 },
     ' ',
     M_NONE,
     do_none
@@ -650,8 +651,8 @@
 {
     N_("("),
     N_("Start group of calculations"),
-    CALC_MOD_SHIFT_MASK,
-    CALC_KEY_LPAR,
+    { GDK_SHIFT_MASK, 0 },
+    { GDK_parenleft, 0 },
     '(',
     M_NONE,
     do_paren
@@ -659,8 +660,8 @@
 {
     N_(")"),
     N_("End group of calculations"),
-    CALC_MOD_SHIFT_MASK,
-    CALC_KEY_RPAR,
+    { GDK_SHIFT_MASK, 0 },
+    { GDK_parenright, 0 },
     ')',
     M_NONE,
     do_paren
@@ -668,8 +669,8 @@
 {
     N_("Acc"),
     N_("Set accuracy from 0 to 9 numeric places"),
-    CALC_MOD_SHIFT_MASK,
-    CALC_KEY_ACC,
+    { GDK_SHIFT_MASK, 0 },
+    { GDK_A, 0 },
     'A',
     M_ACC,
     do_pending
@@ -679,8 +680,8 @@
 {
     N_("Con"),
     N_("Constants"),
-    CALC_MOD_SHIFT_MASK,   
-    CALC_KEY_CON,   
+    { GDK_SHIFT_MASK, 0 },   
+    { GDK_numbersign, 0 },   
     '#',
     M_CON,            
     do_pending
@@ -688,8 +689,8 @@
 {
     N_("Fun"),
     N_("User-defined functions"),
-    CALC_MOD_SHIFT_MASK,
-    CALC_KEY_FUN,
+    { GDK_SHIFT_MASK, 0 },
+    { GDK_F, 0 },
     'F',
     M_FUN,
     do_pending
@@ -697,8 +698,8 @@
 {
     N_("Exp"),
     N_("Enter an exponential number"),
-    CALC_MOD_SHIFT_MASK,
-    CALC_KEY_EXP,
+    { GDK_SHIFT_MASK, 0 },
+    { GDK_E, 0 },
     'E',
     M_NONE,
     do_expno
@@ -706,8 +707,8 @@
 {
     N_("e<sup>x</sup>"),
     N_("e to the power of displayed value"),
-    CALC_MOD_SHIFT_MASK,
-    CALC_KEY_ETOX,
+    { GDK_SHIFT_MASK, 0 },
+    { GDK_braceleft, 0 },
     '{',
     M_NONE,
     do_immed
@@ -715,8 +716,8 @@
 {
     N_("10<sup>x</sup>"),
     N_("10 to the power of displayed value"),
-    CALC_MOD_SHIFT_MASK,
-    CALC_KEY_TTOX,
+    { GDK_SHIFT_MASK, 0 },
+    { GDK_braceright, 0 },
     '}',
     M_NONE,
     do_immed
@@ -724,8 +725,8 @@
 {        
     N_("y<sup>x</sup>"),
     N_("y to the power of displayed value"),
-    CALC_MOD_NONE,   
-    CALC_KEY_YTOX,
+    { 0, 0 },   
+    { GDK_y, 0 },
     'y',
     M_NONE,
     do_calc
@@ -733,8 +734,8 @@
 {        
     N_("x!"),
     N_("Factorial of displayed value"),
-    CALC_MOD_SHIFT_MASK,
-    CALC_KEY_FACT,
+    { GDK_SHIFT_MASK, 0 },
+    { GDK_exclam, 0 },
     '!',
     M_NONE,
     do_immed
@@ -742,8 +743,8 @@
 {
     N_("Rand"),
     N_("Random number in the range 0.0 to 1.0"),
-    CALC_MOD_SHIFT_MASK,
-    CALC_KEY_RAND,
+    { GDK_SHIFT_MASK, 0 },
+    { GDK_question, 0 },
     '?',
     M_NONE,
     do_immed
@@ -753,8 +754,8 @@
 {
     N_("D"),
     N_("Hexadecimal digit D"),
-    CALC_MOD_NONE,
-    CALC_KEY_D,
+    { 0, 0 },
+    { GDK_d, 0 },
     'd',
     M_NONE,
     do_number
@@ -762,8 +763,8 @@
 {
     N_("E"),
     N_("Hexadecimal digit E"),
-    CALC_MOD_NONE,
-    CALC_KEY_E,
+    { 0, 0 },
+    { GDK_e, 0 },
     'e',
     M_NONE,
     do_number
@@ -771,8 +772,8 @@
 {
     N_("F"),
     N_("Hexadecimal digit F"),
-    CALC_MOD_NONE,
-    CALC_KEY_F,
+    { 0, 0 },
+    { GDK_f, 0 },
     'f',
     M_NONE,
     do_number
@@ -780,8 +781,8 @@
 {
     N_("Cos"),
     N_("Cosine"),
-    CALC_MOD_SHIFT_MASK,
-    CALC_KEY_COS,
+    { GDK_SHIFT_MASK, 0 },
+    { GDK_J, 0 },
     'J',
     M_NONE,
     do_trig
@@ -789,8 +790,8 @@
 {
     N_("Sin"),
     N_("Sine"),
-    CALC_MOD_SHIFT_MASK,
-    CALC_KEY_SIN,
+    { GDK_SHIFT_MASK, 0 },
+    { GDK_K, 0 },
     'K',
     M_NONE,
     do_trig
@@ -798,8 +799,8 @@
 {        
     N_("Tan"),
     N_("Tangent"),
-    CALC_MOD_SHIFT_MASK,
-    CALC_KEY_TAN,
+    { GDK_SHIFT_MASK, 0 },
+    { GDK_L, 0 },
     'L',
     M_NONE,
     do_trig
@@ -807,8 +808,8 @@
 {      
     N_("Ln"),
     N_("Natural log"),
-    CALC_MOD_SHIFT_MASK,
-    CALC_KEY_LN,
+    { GDK_SHIFT_MASK, 0 },
+    { GDK_N, 0 },
     'N',
     M_NONE,
     do_immed
@@ -816,8 +817,8 @@
 { 
     N_("Log"),
     N_("Base 10 log"),
-    CALC_MOD_SHIFT_MASK,
-    CALC_KEY_LOG,
+    { GDK_SHIFT_MASK, 0 },
+    { GDK_G, 0 },
     'G',
     M_NONE,
     do_immed
@@ -827,8 +828,8 @@
 {
     N_("A"),
     N_("Hexadecimal digit A"),
-    CALC_MOD_NONE,
-    CALC_KEY_A,
+    { 0, 0 },
+    { GDK_a, 0 },
     'a',
     M_NONE,
     do_number
@@ -836,8 +837,8 @@
 {
     N_("B"),
     N_("Hexadecimal digit B"),
-    CALC_MOD_NONE,
-    CALC_KEY_B,
+    { 0, 0 },
+    { GDK_b, 0 },
     'b',
     M_NONE,
     do_number
@@ -845,8 +846,8 @@
 {     
     N_("C"),
     N_("Hexadecimal digit C"),
-    CALC_MOD_NONE,
-    CALC_KEY_C,
+    { 0, 0 },
+    { GDK_c, 0 },
     'c',
     M_NONE,
     do_number
@@ -854,8 +855,8 @@
 {
     N_("Or"),
     N_("Logical OR"),
-    CALC_MOD_SHIFT_MASK,
-    CALC_KEY_OR,
+    { GDK_SHIFT_MASK, 0 },
+    { GDK_bar, 0 },
     '|',
     M_NONE,
     do_calc
@@ -863,8 +864,8 @@
 {
     N_("And"),
     N_("Logical AND"),
-    CALC_MOD_SHIFT_MASK,
-    CALC_KEY_AND,
+    { GDK_SHIFT_MASK, 0 },
+    { GDK_ampersand, 0 },
     '&',
     M_NONE,
     do_calc
@@ -872,8 +873,8 @@
 {        
     N_("Not"),
     N_("Logical NOT"),
-    CALC_MOD_SHIFT_MASK,
-    CALC_KEY_NOT,
+    { GDK_SHIFT_MASK, 0 },
+    { GDK_asciitilde, 0 },
     '~',
     M_NONE,
     do_immed
@@ -881,8 +882,8 @@
 {
     N_("Xor"),
     N_("Logical XOR"),
-    CALC_MOD_SHIFT_MASK,
-    CALC_KEY_XOR,
+    { GDK_SHIFT_MASK, 0 },
+    { GDK_caret, 0 },
     '^',
     M_NONE,
     do_calc
@@ -890,8 +891,8 @@
 {
     N_("Xnor"),
     N_("Logical XNOR"),
-    CALC_MOD_NONE,
-    CALC_KEY_XNOR,
+    { 0, 0 },
+    { GDK_n, 0 },
     'n',
     M_NONE,
     do_calc
@@ -932,14 +933,13 @@
 
     init_text();               /* Setup text strings depending upon language. */
     init_vars();               /* Setup default values for variables. */
-    init_key_types();          /* Assign toolkit specific key values. */
     load_resources();          /* Get resources from various places. */
     read_resources();          /* Read resources from merged database. */
     get_options(argc, argv);   /* Get command line arguments. */
     read_cfdefs();             /* Read constant/function definitions. */
     make_frames();             /* Create gcalctool window frames. */
 
-    v->current    = copy_button_info(button_for_value(KEY_EQ.value));
+    v->current    = copy_button_info(button_for_value(KEY_EQ.value[0]));
     v->shelf      = NULL;      /* No selection for shelf initially. */
     v->noparens   = 0;         /* No unmatched brackets initially. */
     v->opsptr     = 0;         /* Nothing on the parentheses op stack. */
Index: gcalctool/calctool.h
===================================================================
RCS file: /cvs/gnome/gcalctool/gcalctool/calctool.h,v
retrieving revision 1.31
diff -u -r1.31 calctool.h
--- gcalctool/calctool.h	25 Mar 2003 19:26:10 -0000	1.31
+++ gcalctool/calctool.h	24 Apr 2003 20:51:31 -0000
@@ -74,37 +74,6 @@
 
 enum trig_type { DEG, GRAD, RAD };          /* Trigonometric types. */
 
-/* Key types - real values assigned in init_key_types(). */
-enum key_type {
-    CALC_KEY_7,    CALC_KEY_8,    CALC_KEY_9,    CALC_KEY_DIV,
-                   CALC_KEY_BSP,  CALC_KEY_CE,   CALC_KEY_CLR,
-    CALC_KEY_4,    CALC_KEY_5,    CALC_KEY_6,    CALC_KEY_MUL,
-    CALC_KEY_ACC,  CALC_KEY_CHS,  CALC_KEY_INT,  CALC_KEY_STO,
-    CALC_KEY_1,    CALC_KEY_2,    CALC_KEY_3,    CALC_KEY_SUB,
-    CALC_KEY_PER,  CALC_KEY_SQRT, CALC_KEY_FRAC, CALC_KEY_RCL,
-    CALC_KEY_0,    CALC_KEY_PNT,  CALC_KEY_EQ,   CALC_KEY_ADD,
-    CALC_KEY_REC,  CALC_KEY_SQR,  CALC_KEY_ABS,  CALC_KEY_EXCH,
-
-    CALC_KEY_CTRM, CALC_KEY_DDB,  CALC_KEY_FV,   CALC_KEY_PMT,
-    CALC_KEY_PV,   CALC_KEY_RATE, CALC_KEY_SLN,  CALC_KEY_SYD,
-    CALC_KEY_TERM,
-
-    CALC_KEY_LSFT, CALC_KEY_RSFT, CALC_KEY_16,   CALC_KEY_32,
-                   CALC_KEY_LPAR, CALC_KEY_RPAR,
-    CALC_KEY_CON,  CALC_KEY_FUN,  CALC_KEY_EXP,  CALC_KEY_ETOX,
-    CALC_KEY_TTOX, CALC_KEY_YTOX, CALC_KEY_FACT, CALC_KEY_RAND,
-    CALC_KEY_D,    CALC_KEY_E,    CALC_KEY_F,    CALC_KEY_COS,
-    CALC_KEY_SIN,  CALC_KEY_TAN,  CALC_KEY_LN,   CALC_KEY_LOG,
-    CALC_KEY_A,    CALC_KEY_B,    CALC_KEY_C,    CALC_KEY_OR,
-    CALC_KEY_AND,  CALC_KEY_NOT,  CALC_KEY_XOR,  CALC_KEY_XNOR,
-    CALC_KEY_NONE
-};
-
-/* Modifier types - real values assigned in init_key_types(). */
-enum mod_type {
-    CALC_MOD_NONE, CALC_MOD_SHIFT_MASK, CALC_MOD_CONTROL_MASK
-};
-
 /* Abbreviations for the gcalctool keyboard and menu equivalents. */
 
 #define KEY_DIV   b_buttons[3]              /* / */
@@ -203,6 +172,7 @@
 #define MAXBASES       4          /* Maximum number of numeric bases. */
 #define MAXCONFUN      10         /* Maximum number of constants/functions. */
 #define MAXDISPMODES   3          /* Maximum number of display modes. */
+#define MAXEXTRAS      6          /* Maximum number of keysym alternates. */
 #define MAXMODES       3          /* Maximum number of calculator modes. */
 #define MAXREGS        10         /* Maximum number of memory registers. */
 #define MAXSTACK       256        /* Parenthese stack size. */
@@ -242,8 +212,8 @@
 struct button {
     char *str;               /* Button display string. */
     char *hstr;              /* Button help string. */
-    enum mod_type mods;      /* Keyboard modifiers (Shift, Ctrl, ...). */
-    enum key_type value;     /* Unique button keyboard equivalent. */
+    guint mods[MAXEXTRAS];   /* Keyboard modifiers (Shift, Ctrl, ...). */
+    guint value[MAXEXTRAS];  /* Button keyboard equivalents. */
     char func_char;          /* Unique function string character. */
     enum menu_type mtype;    /* Type of popup menu (if any). */
     void (*func)();          /* Function to obey on button press. */
@@ -388,7 +358,6 @@
 void initialise();
 void init_args();
 void init_frame_sizes();
-void init_key_types();
 void init_vars();
 void init_Xvars(int *, char **);
 void key_init();
Index: gcalctool/display.c
===================================================================
RCS file: /cvs/gnome/gcalctool/gcalctool/display.c,v
retrieving revision 1.19
diff -u -r1.19 display.c
--- gcalctool/display.c	25 Mar 2003 19:26:10 -0000	1.19
+++ gcalctool/display.c	24 Apr 2003 20:51:31 -0000
@@ -76,8 +76,8 @@
 
     new->str = old->str;
     new->hstr = old->hstr;
-    new->mods = old->mods;
-    new->value = old->value;
+    new->mods[0] = old->mods[0];
+    new->value[0] = old->value[0];
     new->func_char = old->func_char;
     new->mtype = old->mtype;
     new->func = old->func;
@@ -430,20 +430,20 @@
 
 /* Reassign "extra" values. */
 
-    if (v->current->value == 'x') {
-        v->current->value = '*';
+    if (v->current->value[0] == 'x') {
+        v->current->value[0] = '*';
     }
-    if (v->current->value == GDK_Return) {
-        v->current->value = '=';
+    if (v->current->value[0] == GDK_Return) {
+        v->current->value[0] = '=';
     }
-    if (v->current->value == 'Q') {
-        v->current->value = 'q';
+    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 == validkeys[i]) {
+            if (v->current->value[0] == validkeys[i]) {
                 isvalid = 1;
             }
         }
Index: gcalctool/functions.c
===================================================================
RCS file: /cvs/gnome/gcalctool/gcalctool/functions.c,v
retrieving revision 1.21
diff -u -r1.21 functions.c
--- gcalctool/functions.c	13 Apr 2003 12:18:45 -0000	1.21
+++ gcalctool/functions.c	24 Apr 2003 20:51:31 -0000
@@ -52,8 +52,8 @@
     int i;
 
     for (i = 0; i <= 9; i++) {
-        if (v->current->value == get_menu_entry(M_ACC, i)) {
-            v->accuracy = char_val(v->current->value);
+        if (v->current->value[0] == get_menu_entry(M_ACC, i)) {
+            v->accuracy = char_val(v->current->value[0]);
             SPRINTF(intval, "%d", v->accuracy);
             put_resource(R_ACCURACY, intval);
             make_registers();
@@ -269,7 +269,7 @@
 
     if (!(v->opsptr && !v->show_paren)) {  /* Don't do if processing parens. */
         if (key_equal(v->current, KEY_EQ) && 
-            IS_KEY(v->old_cal_value, KEY_EQ.value)) {
+            IS_KEY(v->old_cal_value, KEY_EQ.value[0])) {
             if (v->new_input) {
                 mpstr(v->MPlast_input, v->MPresult);
             } else {
@@ -280,77 +280,77 @@
 
 
     if (!key_equal(v->current, KEY_EQ) && 
-        IS_KEY(v->old_cal_value, KEY_EQ.value)) {
+        IS_KEY(v->old_cal_value, KEY_EQ.value[0])) {
         v->cur_op = '?';
     }
 
-    if (IS_KEY(v->cur_op, KEY_COS.value) ||               /* Cos */
-        IS_KEY(v->cur_op, KEY_SIN.value) ||               /* Sin */
-        IS_KEY(v->cur_op, KEY_TAN.value) ||               /* Tan */
+    if (IS_KEY(v->cur_op, KEY_COS.value[0]) ||            /* Cos */
+        IS_KEY(v->cur_op, KEY_SIN.value[0]) ||            /* Sin */
+        IS_KEY(v->cur_op, KEY_TAN.value[0]) ||            /* Tan */
         v->cur_op == '?') {                               /* Undefined */
         mpstr(v->MPdisp_val, v->MPresult);
 
-    } else if (IS_KEY(v->cur_op, KEY_ADD.value)) {        /* Addition */
+    } else if (IS_KEY(v->cur_op, KEY_ADD.value[0])) {     /* Addition */
         mpadd(v->MPresult, v->MPdisp_val, v->MPresult);
 
-    } else if (IS_KEY(v->cur_op, KEY_SUB.value)) {        /* Subtraction. */
+    } else if (IS_KEY(v->cur_op, KEY_SUB.value[0])) {     /* Subtraction. */
         mpsub(v->MPresult, v->MPdisp_val, v->MPresult);
 
     } else if (v->cur_op == '*' ||
-               IS_KEY(v->cur_op, KEY_MUL.value)) {        /* Multiplication */
+               IS_KEY(v->cur_op, KEY_MUL.value[0])) {     /* Multiplication */
         mpmul(v->MPresult, v->MPdisp_val, v->MPresult);
 
-    } else if (IS_KEY(v->cur_op, KEY_DIV.value)) {        /* Division. */
+    } else if (IS_KEY(v->cur_op, KEY_DIV.value[0])) {     /* Division. */
         mpdiv(v->MPresult, v->MPdisp_val, v->MPresult);
 
-    } else if (IS_KEY(v->cur_op, KEY_PER.value)) {        /* % */
+    } else if (IS_KEY(v->cur_op, KEY_PER.value[0])) {     /* % */
         mpmul(v->MPresult, v->MPdisp_val, v->MPresult);
         MPstr_to_num("0.01", DEC, MP1);
         mpmul(v->MPresult, MP1, v->MPresult);
 
-    } else if (IS_KEY(v->cur_op, KEY_YTOX.value)) {       /* y^x */
+    } else if (IS_KEY(v->cur_op, KEY_YTOX.value[0])) {    /* y^x */
         mppwr2(v->MPresult, v->MPdisp_val, v->MPresult);
 
-    } else if (IS_KEY(v->cur_op, KEY_AND.value)) {        /* And */
+    } else if (IS_KEY(v->cur_op, KEY_AND.value[0])) {     /* 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, KEY_OR.value)) {         /* Or */
+    } else if (IS_KEY(v->cur_op, KEY_OR.value[0])) {      /* 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, KEY_XOR.value)) {        /* Xor */
+    } else if (IS_KEY(v->cur_op, KEY_XOR.value[0])) {     /* 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, KEY_XNOR.value)) {       /* Xnor */
+    } else if (IS_KEY(v->cur_op, KEY_XNOR.value[0])) {    /* 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, KEY_EQ.value)) {         /* Equals */
+    } else if (IS_KEY(v->cur_op, KEY_EQ.value[0])) {      /* Equals */
         /* do nothing */;
     }
 
     show_display(v->MPresult);
 
     if (!(key_equal(v->current, KEY_EQ) && 
-          IS_KEY(v->old_cal_value, KEY_EQ.value))) {
+          IS_KEY(v->old_cal_value, KEY_EQ.value[0]))) {
         mpstr(v->MPdisp_val, v->MPlast_input);
     }
 
     mpstr(v->MPresult, v->MPdisp_val);
     if (!key_equal(v->current, KEY_EQ)) {
-        v->cur_op = v->current->value;
+        v->cur_op = v->current->value[0];
     }
-    v->old_cal_value = v->current->value;
+    v->old_cal_value = v->current->value[0];
     v->new_input     = v->key_exp = 0;
 }
 
@@ -376,8 +376,8 @@
 static void
 do_constant()
 {
-    if (v->current->value >= '0' && v->current->value <= '9') {
-        mpstr(v->MPcon_vals[char_val(v->current->value)], v->MPdisp_val);
+    if (v->current->value[0] >= '0' && v->current->value[0] <= '9') {
+        mpstr(v->MPcon_vals[char_val(v->current->value[0])], v->MPdisp_val);
         show_display(v->MPdisp_val);
     }
 }
@@ -416,8 +416,8 @@
     int MPtemp[MP_SIZE];
 
     mpstr(v->MPdisp_val, MPtemp);
-    mpstr(v->MPmvals[char_val(v->current->value)], v->MPdisp_val);
-    mpstr(MPtemp, v->MPmvals[char_val(v->current->value)]);
+    mpstr(v->MPmvals[char_val(v->current->value[0])], v->MPdisp_val);
+    mpstr(MPtemp, v->MPmvals[char_val(v->current->value[0])]);
     make_registers();
 }
 
@@ -499,8 +499,8 @@
 
     scurwin = v->curwin;
     v->pending = 0;
-    if (v->current->value >= '0' && v->current->value <= '9') {
-        fno = char_val(v->current->value);
+    if (v->current->value[0] >= '0' && v->current->value[0] <= '9') {
+        fno = char_val(v->current->value[0]);
         process_str(v->fun_vals[fno]);
     }
     v->curwin = scurwin;
@@ -618,12 +618,12 @@
     int len, n;
     static int maxvals[4] = { 1, 7, 9, 15 };
 
-    nextchar = v->current->value;
-    n = v->current->value - '0';
+    nextchar = v->current->value[0];
+    n = v->current->value[0] - '0';
     if (v->base == HEX && 
-        v->current->value >= 'a' && v->current->value <= 'f') {
+        v->current->value[0] >= 'a' && v->current->value[0] <= 'f') {
         nextchar -= 32;             /* Convert to uppercase hex digit. */
-        n = v->current->value - 'a' + 10;
+        n = v->current->value[0] - 'a' + 10;
     }
     if (n > maxvals[(int) v->base]) {
         beep();
@@ -674,7 +674,7 @@
         if (!v->noparens && v->cur_op != '?') {
             paren_disp(v->cur_op);
         }
-        v->pending = v->current->value;
+        v->pending = v->current->value[0];
         v->noparens++;
 
 /*  If we haven't had any left brackets yet, and this is a right bracket,
@@ -689,7 +689,7 @@
         }
         v->noparens--;
         if (!v->noparens) {
-            paren_disp(v->current->value);
+            paren_disp(v->current->value[0]);
             ptr = v->display;
             while (*ptr != '(') {
                 ptr++;
@@ -700,7 +700,7 @@
             return;
         }
     }
-    paren_disp(v->current->value);
+    paren_disp(v->current->value[0]);
 }
 
 
@@ -730,32 +730,32 @@
         }
     }
 
-    if (IS_KEY(v->pending, KEY_CON.value))  {                    /* Con */
+    if (IS_KEY(v->pending, KEY_CON.value[0]))  {                 /* Con */
         do_constant();
-    } else if (IS_KEY(v->pending, KEY_EXCH.value)) {             /* Exch */
+    } else if (IS_KEY(v->pending, KEY_EXCH.value[0])) {          /* Exch */
         do_exchange();
-    } else if (IS_KEY(v->pending, KEY_FUN.value))  {             /* Fun */
+    } else if (IS_KEY(v->pending, KEY_FUN.value[0]))  {          /* Fun */
         do_function();
-    } else if (IS_KEY(v->pending, KEY_STO.value) ||              /* Sto */
-               IS_KEY(v->pending, KEY_RCL.value)) {              /* Rcl */
+    } else if (IS_KEY(v->pending, KEY_STO.value[0]) ||           /* Sto */
+               IS_KEY(v->pending, KEY_RCL.value[0])) {           /* Rcl */
         do_sto_rcl();
-        if (IS_KEY(v->pending_op, KEY_ADD.value) ||
-            IS_KEY(v->pending_op, KEY_SUB.value) ||
-            IS_KEY(v->pending_op, KEY_MUL.value) ||
-            IS_KEY(v->pending_op, KEY_DIV.value)) {
+        if (IS_KEY(v->pending_op, KEY_ADD.value[0]) ||
+            IS_KEY(v->pending_op, KEY_SUB.value[0]) ||
+            IS_KEY(v->pending_op, KEY_MUL.value[0]) ||
+            IS_KEY(v->pending_op, KEY_DIV.value[0])) {
             return;
         }
-    } else if (IS_KEY(v->pending, KEY_LSFT.value) ||             /* < */
-               IS_KEY(v->pending, KEY_RSFT.value)) {             /* > */
+    } else if (IS_KEY(v->pending, KEY_LSFT.value[0]) ||          /* < */
+               IS_KEY(v->pending, KEY_RSFT.value[0])) {          /* > */
         do_shift();
-    } else if (IS_KEY(v->pending, KEY_ACC.value)) {              /* Acc */
+    } else if (IS_KEY(v->pending, KEY_ACC.value[0])) {           /* Acc */
         do_accuracy();
-    } else if (IS_KEY(v->pending, KEY_LPAR.value)) {             /* ( */
+    } else if (IS_KEY(v->pending, KEY_LPAR.value[0])) {          /* ( */
         do_paren();
         return;
     } else if (!v->pending) {
         save_pending_values(v->current);
-        v->pending_op = KEY_EQ.value;
+        v->pending_op = KEY_EQ.value[0];
         return;
     }
 
@@ -814,22 +814,22 @@
     enum menu_type mtype = M_LSHF;
     double dval;
 
-    if (IS_KEY(v->pending, KEY_LSFT.value)) {
+    if (IS_KEY(v->pending, KEY_LSFT.value[0])) {
         mtype = M_LSHF;
-    } else if (IS_KEY(v->pending, KEY_RSFT.value)) {
+    } else if (IS_KEY(v->pending, KEY_RSFT.value[0])) {
         mtype = M_RSHF;
     }
 
     for (i = 0; i <= 15; i++) {
-        if (v->current->value == get_menu_entry(mtype, i)) {
-            shift = char_val(v->current->value);
+        if (v->current->value[0] == get_menu_entry(mtype, i)) {
+            shift = char_val(v->current->value[0]);
             MPstr_to_num(v->display, v->base, MPtemp);
             mpcmd(MPtemp, &dval);
             temp = ibool(dval);
 
-            if (IS_KEY(v->pending, KEY_LSFT.value)) {
+            if (IS_KEY(v->pending, KEY_LSFT.value[0])) {
                 temp = temp << shift;
-            } else if (IS_KEY(v->pending, KEY_RSFT.value)) {
+            } else if (IS_KEY(v->pending, KEY_RSFT.value[0])) {
                 temp = temp >> shift;
             }
 
@@ -849,29 +849,29 @@
     int MPn[MP_SIZE], n;
     enum menu_type mtype = M_RCL;
 
-    if (IS_KEY(v->pending, KEY_RCL.value)) {
+    if (IS_KEY(v->pending, KEY_RCL.value[0])) {
         mtype = M_RCL;
-    } else if (IS_KEY(v->pending, KEY_STO.value)) {
+    } else if (IS_KEY(v->pending, KEY_STO.value[0])) {
         mtype = M_STO;
     }
 
-    if (IS_KEY(v->pending, KEY_RCL.value)) {                     /* Rcl */
-        mpstr(v->MPmvals[char_val(v->current->value)], v->MPdisp_val);
+    if (IS_KEY(v->pending, KEY_RCL.value[0])) {                  /* Rcl */
+        mpstr(v->MPmvals[char_val(v->current->value[0])], v->MPdisp_val);
         v->new_input = 0;
  
-    } else if (IS_KEY(v->pending, KEY_STO.value)) {              /* Sto */
-        n = char_val(v->current->value);
+    } else if (IS_KEY(v->pending, KEY_STO.value[0])) {           /* Sto */
+        n = char_val(v->current->value[0]);
  
-        if (IS_KEY(v->pending_op, KEY_ADD.value)) {              /* + */
+        if (IS_KEY(v->pending_op, KEY_ADD.value[0])) {           /* + */
             mpstr(v->MPmvals[n], MPn);
             mpadd(MPn, v->MPdisp_val, v->MPmvals[n]);
-        } else if (IS_KEY(v->pending_op, KEY_SUB.value)) {       /* - */
+        } else if (IS_KEY(v->pending_op, KEY_SUB.value[0])) {    /* - */
             mpstr(v->MPmvals[n], MPn);
             mpsub(MPn, v->MPdisp_val, v->MPmvals[n]);
-        } else if (IS_KEY(v->pending_op, KEY_MUL.value)) {       /* x */
+        } else if (IS_KEY(v->pending_op, KEY_MUL.value[0])) {    /* x */
             mpstr(v->MPmvals[n], MPn);
             mpmul(MPn, v->MPdisp_val, v->MPmvals[n]);
-        } else if (IS_KEY(v->pending_op, KEY_DIV.value)) {       /* / */
+        } else if (IS_KEY(v->pending_op, KEY_DIV.value[0])) {    /* / */
             mpstr(v->MPmvals[n], MPn);
             mpdiv(MPn, v->MPdisp_val, v->MPmvals[n]);
         } else {
@@ -887,7 +887,7 @@
         key_equal(v->current, KEY_SUB) ||
         key_equal(v->current, KEY_MUL) || 
         key_equal(v->current, KEY_DIV)) {
-        v->pending_op = v->current->value;
+        v->pending_op = v->current->value[0];
     }
 }
 
@@ -999,9 +999,9 @@
 {
     v->ttype = t;
     put_resource(R_TRIG, Rtstr[(int) v->ttype]);
-    if (IS_KEY(v->cur_op, KEY_COS.value) ||
-        IS_KEY(v->cur_op, KEY_SIN.value) ||
-        IS_KEY(v->cur_op, KEY_TAN.value)) {
+    if (IS_KEY(v->cur_op, KEY_COS.value[0]) ||
+        IS_KEY(v->cur_op, KEY_SIN.value[0]) ||
+        IS_KEY(v->cur_op, KEY_TAN.value[0])) {
         mpstr(v->MPtresults[(int) v->ttype], v->MPdisp_val);
         show_display(v->MPtresults[(int) v->ttype]);
     }
@@ -1021,7 +1021,7 @@
 int
 key_equal(struct button *x, struct button y)
 {
-    return(x->value == y.value && x->mods == y.mods);
+    return(x->value[0] == y.value[0] && x->mods[0] == y.mods[0]);
 }
 
 
@@ -1200,7 +1200,7 @@
  *  Increment parentheses count.
  */
 
-    if (IS_KEY(current, KEY_LPAR.value)) {
+    if (IS_KEY(current, KEY_LPAR.value[0])) {
         if (!v->noparens && v->cur_op != '?') {
             push_num(v->MPresult);
             push_op(-1);
@@ -1224,12 +1224,12 @@
  *  clear the stack pointers and current operation, and show the display.
  */
 
-    } else if (IS_KEY(current, KEY_RPAR.value)) {
+    } else if (IS_KEY(current, KEY_RPAR.value[0])) {
         v->noparens--;
         push_op('=');
         last_lpar = v->opsptr - 1;
         last_num = v->numsptr;
-        while (!IS_KEY(v->opstack[last_lpar], KEY_LPAR.value)) {
+        while (!IS_KEY(v->opstack[last_lpar], KEY_LPAR.value[0])) {
             if (v->opstack[last_lpar] == -1) {
                 last_num--;
             }
@@ -1238,7 +1238,7 @@
         process_stack(last_lpar + 1, last_num, v->opsptr - last_lpar - 1);
         if (!v->noparens) {
             if (v->opsptr > 1) {
-                push_op(KEY_EQ.value);
+                push_op(KEY_EQ.value[0]);
                 process_stack(0, 0, v->opsptr);
             }
             v->pending = v->opsptr = v->numsptr = 0;
@@ -1299,7 +1299,7 @@
 save_pending_values(struct button *but)
 {
     v->pending_but = but;
-    v->pending = but->value;
+    v->pending = but->value[0];
 }
 
 
@@ -1341,7 +1341,7 @@
     int i;
 
     for (i = 0; i < max_buttons; i++) {
-        if (buttons[i].value == val) {
+        if (buttons[i].value[0] == val) {
             return(&buttons[i]);
         }
     }
Index: gcalctool/graphics.c
===================================================================
RCS file: /cvs/gnome/gcalctool/gcalctool/graphics.c,v
retrieving revision 1.17
diff -u -r1.17 graphics.c
--- gcalctool/graphics.c	20 Feb 2003 15:50:37 -0000	1.17
+++ gcalctool/graphics.c	24 Apr 2003 20:51:31 -0000
@@ -33,9 +33,9 @@
 {
     if (item != -1) {
         if (IS_KEY(v->pending, KEY_LPAR.value)) {   /* Inside parentheses? */
-            v->current->value = n->value;
+            v->current->value[0] = n->value[0];
             do_paren();
-            v->current->value = item;
+            v->current->value[0] = item;
             do_paren();
         } else {
             save_pending_values(n);
@@ -91,7 +91,7 @@
         } else {
             v->cur_ch = v->opstack[startop + i];
             if (v->pending) {
-                v->current->value = v->cur_ch;
+                v->current->value[0] = v->cur_ch;
                 do_pending();
             } else {
                 struct button *next = button_for_fc(v->cur_ch);
Index: gcalctool/gtk.c
===================================================================
RCS file: /cvs/gnome/gcalctool/gcalctool/gtk.c,v
retrieving revision 1.82
diff -u -r1.82 gtk.c
--- gcalctool/gtk.c	15 Apr 2003 20:02:29 -0000	1.82
+++ gcalctool/gtk.c	24 Apr 2003 20:51:31 -0000
@@ -60,29 +60,6 @@
 #define BUT_PNT   X->bas_buttons[25]       /* . */
 #define BUT_EQ    X->bas_buttons[26]       /* = */
 
-static int keyvals[] = {
-  GDK_7, GDK_8, GDK_9, GDK_slash, GDK_BackSpace, GDK_BackSpace, GDK_Delete,
-  GDK_4, GDK_5, GDK_6, GDK_asterisk, GDK_A, GDK_C, GDK_i, GDK_S,
-  GDK_1, GDK_2, GDK_3, GDK_minus, GDK_percent, GDK_s, GDK_colon, GDK_R,
-  GDK_0, GDK_period, GDK_equal, GDK_plus, GDK_r, GDK_at, GDK_u, GDK_X,
-  GDK_m, GDK_D, GDK_v, GDK_P, GDK_p, GDK_T, GDK_l, GDK_Y,
-  GDK_T,
-
-  GDK_less, GDK_greater, 
-    GDK_bracketright, GDK_bracketleft, GDK_parenleft, GDK_parenright, 
-  GDK_numbersign, GDK_F, GDK_E, 
-    GDK_braceleft, GDK_braceright, GDK_y, GDK_exclam, GDK_question,
-  GDK_d, GDK_e, GDK_f, GDK_J, GDK_K, GDK_L, GDK_N, GDK_G,
-  GDK_a, GDK_b, GDK_c, 
-    GDK_bar, GDK_ampersand, GDK_asciitilde, GDK_caret, GDK_n,
-  0
-};
-
-static int modvals[] = {
-    0, GDK_SHIFT_MASK, GDK_CONTROL_MASK
-};
-
-
 typedef struct Xobject {               /* Gtk+/Xlib graphics object. */
     GtkAccelGroup *kbd_accel;
     GdkAtom clipboard_atom;
@@ -108,6 +85,10 @@
     GtkWidget *menus[MAXMENUS];
     GtkWidget *trig[MAXTRIGMODES];     /* Trigonometric mode. */
 
+    gboolean ctrl_l;             /* Set if the left Control key is pressed. */
+    gboolean ctrl_r;             /* Set if the right Control key is pressed. */
+    gboolean shft_l;             /* Set if the left Shift key is pressed. */
+    gboolean shft_r;             /* Set if the right Shift key is pressed. */
 
     GtkWidget *bas_buttons[BROWS * BCOLS];
     GtkWidget *fin_buttons[FROWS * FCOLS];
@@ -155,7 +136,8 @@
 static gboolean aframe_key_cb(GtkWidget *, GdkEventKey *, gpointer);
 static gboolean dismiss_aframe(GtkWidget *, GdkEvent *, gpointer);
 static gboolean dismiss_rframe(GtkWidget *, GdkEvent *, gpointer);
-static gboolean event_cb(GtkWidget *, GdkEvent *, gpointer);
+static gboolean kframe_key_press_cb(GtkWidget *, GdkEventKey *, gpointer);
+static gboolean kframe_key_release_cb(GtkWidget *, GdkEventKey *, gpointer);
 
 static void about_cb(GtkWidget *, gpointer);
 static void add_cf_column(GtkTreeView *, gchar *, gint, gboolean);
@@ -166,7 +148,6 @@
 static void cell_edited(GtkCellRendererText *, 
                         const gchar *, const gchar *, gpointer);
 static void create_con_fun_menu(enum menu_type);
-static void create_kbd_accel(GtkWidget *, guint, guint);
 static void create_menu_item_with_markup(char *, int, int);
 static void disp_cb(GtkToggleButton *, gpointer);
 static void hyp_cb(GtkToggleButton *, gpointer);
@@ -361,41 +342,6 @@
 }
 
 
-static void
-add_extra_kbd_accels()
-{
-    create_kbd_accel(BUT_EQ,   0, GDK_Return);
-    create_kbd_accel(BUT_MUL,  0, GDK_x);
-
-    /* Numeric keypad. */
-    create_kbd_accel(BUT_EQ,  0, GDK_KP_Enter);
-    create_kbd_accel(BUT_PNT, 0, GDK_KP_Delete);
-    create_kbd_accel(BUT_4,   0, GDK_KP_Left);
-    create_kbd_accel(BUT_4,   0, GDK_KP_4);
-    create_kbd_accel(BUT_6,   0, GDK_KP_Right);
-    create_kbd_accel(BUT_6,   0, GDK_KP_6);
-    create_kbd_accel(BUT_8,   0, GDK_KP_Up);
-    create_kbd_accel(BUT_8,   0, GDK_KP_8);
-    create_kbd_accel(BUT_2,   0, GDK_KP_Down);
-    create_kbd_accel(BUT_2,   0, GDK_KP_2);
-    create_kbd_accel(BUT_1,   0, GDK_End);
-    create_kbd_accel(BUT_1,   0, GDK_KP_1);
-    create_kbd_accel(BUT_3,   0, GDK_Page_Down);
-    create_kbd_accel(BUT_3,   0, GDK_KP_3);
-    create_kbd_accel(BUT_7,   0, GDK_Home);
-    create_kbd_accel(BUT_7,   0, GDK_KP_7);
-    create_kbd_accel(BUT_9,   0, GDK_Page_Up);
-    create_kbd_accel(BUT_9,   0, GDK_KP_9);
-
-    create_kbd_accel(BUT_0,   0, GDK_KP_0);
-    create_kbd_accel(BUT_5,   0, GDK_KP_5);
-    create_kbd_accel(BUT_ADD, 0, GDK_KP_Add);
-    create_kbd_accel(BUT_SUB, 0, GDK_KP_Subtract);
-    create_kbd_accel(BUT_MUL, 0, GDK_KP_Multiply);
-    create_kbd_accel(BUT_DIV, 0, GDK_KP_Divide);
-}
-
-
 /*ARGSUSED*/
 static void
 aframe_cancel_cb(GtkButton *button, gpointer user_data)
@@ -810,13 +756,6 @@
 }
 
 
-static void
-create_kbd_accel(GtkWidget *button, guint button_mods, guint button_key) {
-    gtk_widget_add_accelerator(button, "activate", X->kbd_accel,
-                               button_key, button_mods, GTK_ACCEL_VISIBLE);
-}
-
-
 static char *
 item_factory_translate_func (const char *path, gpointer func_data)
 {
@@ -909,12 +848,15 @@
     X->bas_frame = make_but_frame(X->kvbox, X->bas_buttons,
                                   &b_buttons[0], BROWS, BCOLS, "bas");
     gtk_widget_show(X->bas_frame);
-    add_extra_kbd_accels();
     gtk_window_add_accel_group(GTK_WINDOW(X->kframe), X->kbd_accel);
     grey_buttons(v->base);
     gtk_window_set_icon(GTK_WINDOW(X->kframe), X->icon);
 
-    g_signal_connect(G_OBJECT(X->kframe), "event", G_CALLBACK(event_cb), NULL);
+    g_signal_connect(G_OBJECT(X->kframe), "key_press_event",
+                     G_CALLBACK(kframe_key_press_cb), NULL);
+    g_signal_connect(G_OBJECT(X->kframe), "key_release_event",
+                     G_CALLBACK(kframe_key_release_cb), NULL);
+
     switch (v->modetype) {
         case FINANCIAL:
             view_widget = gtk_item_factory_get_widget_by_action(X->mb_fact, M_FIN);
@@ -1180,108 +1122,6 @@
 }
 
 
-/* Handle keypresses on the numeric keypad for Linux boxen. Whereas assigning
- * additional keyboard character accelerators works for the Solaris platform
- * (see add_extra_kbd_accels above), it seems you have to add an "event" 
- * signal handler on the main gcalctool window, then search for various 
- * keyvals for Linux machines.
- */
-
-static gboolean
-event_cb(GtkWidget *widget, GdkEvent *event, gpointer user_data)
-{
-    GdkEventKey *kevent;
-
-    if (event->type != GDK_KEY_PRESS) {
-        return(FALSE);
-    }
-
-    kevent = (GdkEventKey *) event;
-
-    switch (kevent->keyval) {
-        case GDK_KP_0:
-        case GDK_KP_Insert:
-            gtk_widget_activate(GTK_WIDGET(BUT_0));
-            break;
-
-        case GDK_KP_1:
-        case GDK_KP_End:
-            gtk_widget_activate(GTK_WIDGET(BUT_1));
-            break;
-
-        case GDK_KP_2:
-        case GDK_KP_Down:
-            gtk_widget_activate(GTK_WIDGET(BUT_2));
-            break;
-
-        case GDK_KP_3:
-        case GDK_KP_Next:
-            gtk_widget_activate(GTK_WIDGET(BUT_3));
-            break;
-
-        case GDK_KP_4:
-        case GDK_KP_Left:
-            gtk_widget_activate(GTK_WIDGET(BUT_4));
-            break;
-
-        case GDK_KP_5:
-        case GDK_KP_Begin:
-            gtk_widget_activate(GTK_WIDGET(BUT_5));
-            break;
-
-        case GDK_KP_6:
-        case GDK_KP_Right:
-            gtk_widget_activate(GTK_WIDGET(BUT_6));
-            break;
-
-        case GDK_KP_7:
-        case GDK_KP_Home:
-            gtk_widget_activate(GTK_WIDGET(BUT_7));
-            break;
-
-        case GDK_KP_8:
-        case GDK_KP_Up:
-            gtk_widget_activate(GTK_WIDGET(BUT_8));
-            break;
-
-        case GDK_KP_9:
-        case GDK_KP_Prior:
-            gtk_widget_activate(GTK_WIDGET(BUT_9));
-            break;
-
-        case GDK_KP_Decimal:
-        case GDK_KP_Delete:
-            gtk_widget_activate(GTK_WIDGET(BUT_PNT));
-            break;
-
-        case GDK_KP_Add:
-            gtk_widget_activate(GTK_WIDGET(BUT_ADD));
-            break;
-
-        case GDK_KP_Subtract:
-            gtk_widget_activate(GTK_WIDGET(BUT_SUB));
-            break;
-
-        case GDK_KP_Multiply:
-            gtk_widget_activate(GTK_WIDGET(BUT_MUL));
-            break;
-
-        case GDK_KP_Divide:
-            gtk_widget_activate(GTK_WIDGET(BUT_DIV));
-            break;
-
-        case GDK_KP_Enter:
-            gtk_widget_activate(GTK_WIDGET(BUT_EQ));
-            break;
-
-        default:
-            return(FALSE);
-        }	
-
-    return(TRUE);
-}
-
-
 void
 get_constant(int n)
 {
@@ -1443,32 +1283,111 @@
 }
 
 
-void
-init_key_types()
+static void
+inv_cb(GtkToggleButton *button, gpointer user_data)
 {
-    int i;
+    v->inverse = !v->inverse;
+}
+
 
-    for (i = 0; i < B_NOBUTTONS; i++) {
-        b_buttons[i].value = keyvals[b_buttons[i].value];
-        b_buttons[i].mods  = modvals[b_buttons[i].mods];
+static int
+check_vals(int n, int keyval, 
+           struct button buttons[], GtkWidget *gtk_buttons[])
+{
+    int i, j;
+
+    for (i = 0; i < n; i++) {
+        j = 0;
+        while (buttons[i].value[j] != 0) {
+            if (buttons[i].value[j] == keyval) {
+                if ((buttons[i].mods[j] == 0) &&
+                    ((X->ctrl_l | X->ctrl_r | X->shft_l | X->shft_r) == 0)) {
+                    button_proc(GTK_BUTTON(gtk_buttons[i]), NULL);
+                    return(TRUE);
+                } else if ((buttons[i].mods[j] == GDK_SHIFT_MASK) &&
+                           ((X->shft_l | X->shft_r) == 1)) {
+                    button_proc(GTK_BUTTON(gtk_buttons[i]), NULL);
+                    return(TRUE);
+                } else if ((buttons[i].mods[j] == GDK_CONTROL_MASK) &&
+                           ((X->ctrl_l | X->ctrl_r) == 1)) {
+                    button_proc(GTK_BUTTON(gtk_buttons[i]), NULL);
+                    return(TRUE);
+                }
+            }
+            j++;
+        }
     }
 
-    for (i = 0; i < F_NOBUTTONS; i++) {
-        f_buttons[i].value = keyvals[f_buttons[i].value];
-        f_buttons[i].mods  = modvals[f_buttons[i].mods];
+    return(FALSE);
+}
+
+
+static gboolean
+kframe_key_press_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
+{
+    int i, retval = FALSE;
+
+    if (event->keyval == GDK_Control_L) {
+        X->ctrl_l = TRUE;
+        return(TRUE);
+    } else if (event->keyval == GDK_Control_R) {
+        X->ctrl_r = TRUE;
+        return(TRUE);
+    } else if (event->keyval == GDK_Shift_L) {
+        X->shft_l = TRUE;
+        return(TRUE);
+    } else if (event->keyval == GDK_Shift_R) {
+        X->shft_r = TRUE;
+	return(TRUE);
     }
 
-    for (i = 0; i < S_NOBUTTONS; i++) {
-        s_buttons[i].value = keyvals[s_buttons[i].value];
-        s_buttons[i].mods  = modvals[s_buttons[i].mods];
+    switch (v->modetype) {
+        case BASIC:
+            retval = check_vals(B_NOBUTTONS, event->keyval, 
+                                b_buttons, X->bas_buttons);
+            break;
+
+        case FINANCIAL:
+            retval = check_vals(B_NOBUTTONS, event->keyval,
+            			b_buttons, X->bas_buttons);
+            if (retval != TRUE) {
+                retval = check_vals(F_NOBUTTONS, event->keyval, 
+                                    f_buttons, X->fin_buttons);
+            }
+            break;
+
+        case SCIENTIFIC:
+            retval = check_vals(B_NOBUTTONS, event->keyval,
+                                b_buttons, X->bas_buttons);
+            if (retval != TRUE) {
+                retval = check_vals(S_NOBUTTONS, event->keyval, 
+                                    s_buttons, X->sci_buttons);
+            }
+            break;
     }
+
+    return(retval);
 }
 
 
-static void
-inv_cb(GtkToggleButton *button, gpointer user_data)
+static gboolean
+kframe_key_release_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
 {
-    v->inverse = !v->inverse;
+    if (event->keyval == GDK_Control_L) {
+        X->ctrl_l = FALSE;
+        return(TRUE);
+    } else if (event->keyval == GDK_Control_R) {
+        X->ctrl_r = FALSE;
+        return(TRUE);
+    } else if (event->keyval == GDK_Shift_L) {
+        X->shft_l = FALSE;
+        return(TRUE);
+    } else if (event->keyval == GDK_Shift_R) {
+        X->shft_r = FALSE;
+        return(TRUE);
+    }
+
+    return(FALSE);
 }
 
 
@@ -1578,8 +1497,6 @@
             gtk_widget_ref(Gtk_buttons[n]);
 
             if (strcmp(buttons[n].str, "    ")) {
-                create_kbd_accel(Gtk_buttons[n], buttons[n].mods,
-                                 buttons[n].value);
                 gtk_widget_show(Gtk_buttons[n]);
             } else {
                 gtk_widget_hide(Gtk_buttons[n]);
@@ -1666,8 +1583,8 @@
 {
     int mtype = (int) g_object_get_data(G_OBJECT(mi), "mtype");
 
-    v->current->value = '0' + (int) user_data;
-    handle_menu_selection(X->mrec[mtype], v->current->value);
+    v->current->value[0] = '0' + (int) user_data;
+    handle_menu_selection(X->mrec[mtype], v->current->value[0]);
 }
 
 
