aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorLarry Ewing <lewing@ximian.com>2002-09-25 14:20:06 +0800
committerLarry Ewing <lewing@src.gnome.org>2002-09-25 14:20:06 +0800
commite308c256c892d82c41e244fda8e2e616917a7f5a (patch)
tree79f6fe55d2785601560a47e9a0e9cf4f87d9c340 /widgets
parentcde9bcd22d7b2107ee1a1f84974955b4453889b0 (diff)
downloadgsoc2013-evolution-e308c256c892d82c41e244fda8e2e616917a7f5a.tar.gz
gsoc2013-evolution-e308c256c892d82c41e244fda8e2e616917a7f5a.tar.zst
gsoc2013-evolution-e308c256c892d82c41e244fda8e2e616917a7f5a.zip
add the gtk2 keypad entries (resync with gdk).
2002-09-25 Larry Ewing <lewing@ximian.com> * gal/widgets/e-unicode.c: add the gtk2 keypad entries (resync with gdk). svn path=/trunk/; revision=18212
Diffstat (limited to 'widgets')
-rw-r--r--widgets/misc/e-unicode.c44
1 files changed, 34 insertions, 10 deletions
diff --git a/widgets/misc/e-unicode.c b/widgets/misc/e-unicode.c
index ebf1ede9cb..a291597a7d 100644
--- a/widgets/misc/e-unicode.c
+++ b/widgets/misc/e-unicode.c
@@ -1685,11 +1685,36 @@ static struct {
{ 0x20aa, 0x20aa }, /* NewSheqelSign ₪ NEW SHEQEL SIGN */
{ 0x20ab, 0x20ab }, /* DongSign ₫ DONG SIGN */
{ 0x20ac, 0x20ac }, /* EuroSign € EURO SIGN */
+
+
+ /* Following items added to GTK, not in the xterm table */
+
+ /* Numeric keypad */
+
+ { 0xFF80 /* Space */, ' ' },
+ { 0xFFAA /* Multiply */, '*' },
+ { 0xFFAB /* Add */, '+' },
+ { 0xFFAD /* Subtract */, '-' },
+ { 0xFFAE /* Decimal */, '.' },
+ { 0xFFAF /* Divide */, '/' },
+ { 0xFFB0 /* 0 */, '0' },
+ { 0xFFB1 /* 1 */, '1' },
+ { 0xFFB2 /* 2 */, '2' },
+ { 0xFFB3 /* 3 */, '3' },
+ { 0xFFB4 /* 4 */, '4' },
+ { 0xFFB5 /* 5 */, '5' },
+ { 0xFFB6 /* 6 */, '6' },
+ { 0xFFB7 /* 7 */, '7' },
+ { 0xFFB8 /* 8 */, '8' },
+ { 0xFFB9 /* 9 */, '9' },
+ { 0xFFBD /* Equal */, '=' },
+
+ /* End numeric keypad */
};
/**
* gdk_keyval_to_unicode:
- * @keysym: a GDK key symbol
+ * @keyval: a GDK key symbol
*
* Convert from a GDK key symbol to the corresponding ISO10646 (Unicode)
* character.
@@ -1697,30 +1722,29 @@ static struct {
* Return value: the corresponding unicode character, or 0 if there
* is no corresponding character.
**/
-
guint32
-gdk_keyval_to_unicode (guint keysym)
+gdk_keyval_to_unicode (guint keyval)
{
int min = 0;
int max = sizeof (gdk_keysym_to_unicode_tab) / sizeof (gdk_keysym_to_unicode_tab[0]) - 1;
int mid;
/* First check for Latin-1 characters (1:1 mapping) */
- if ((keysym >= 0x0020 && keysym <= 0x007e) ||
- (keysym >= 0x00a0 && keysym <= 0x00ff))
- return keysym;
+ if ((keyval >= 0x0020 && keyval <= 0x007e) ||
+ (keyval >= 0x00a0 && keyval <= 0x00ff))
+ return keyval;
/* Also check for directly encoded 24-bit UCS characters:
*/
- if ((keysym & 0xff000000) == 0x01000000)
- return keysym & 0x00ffffff;
+ if ((keyval & 0xff000000) == 0x01000000)
+ return keyval & 0x00ffffff;
/* binary search in table */
while (max >= min) {
mid = (min + max) / 2;
- if (gdk_keysym_to_unicode_tab[mid].keysym < keysym)
+ if (gdk_keysym_to_unicode_tab[mid].keysym < keyval)
min = mid + 1;
- else if (gdk_keysym_to_unicode_tab[mid].keysym > keysym)
+ else if (gdk_keysym_to_unicode_tab[mid].keysym > keyval)
max = mid - 1;
else {
/* found it */