GNOME Bugzilla – Bug 333073
number pad operator keys not always recognized by gcalctool
Last modified: 2006-03-28 17:50:48 UTC
Forwarded from: https://launchpad.net/distros/ubuntu/+source/gcalctool/+bug/33224 I'm using Dapper Drake testing (Flight 4 + updates) and Gcalctool, the GNOME calculator v5.7.30. The operator keys on the number pad (plus, minus, multiply & divide) are only recognized by gcalctool when the number lock is enabled in contrast with the digit, decimal and Enter keys on the number pad from which input is always accepted despite the state of the number lock. I propose that the calculator should always accept input from the number pad operator keys regardless of whether the number lock is on or off.
I totally agree, and it certainly works that way on my computer(s). What I suspect is happening is that when you press those number pad keys on your systems, it's generating keysyms that aren't being currently recognized by gcalctool. If you looking in .../gcalctool/gcalctool/calctool.c, you will see there is a huge buttons struct there. Part of each entry defines the keysyms (and their modifiers) that are applicable for each button. For example, here's the divide entry: { /* Note to translators: this is a division sign (\303\267) */ N_("\303\267"), N_("Divide"), NULL, { 0, GDK_SHIFT_MASK, 0, 0, GDK_SHIFT_MASK, 0 }, { GDK_slash, GDK_slash, GDK_KP_Divide, GDK_R5, GDK_slash, 0 }, '/', M_NONE, do_calc, N_("/"), binop }, What you can do to determine if you are indeed generating different keysyms is to add a bit of debug to the kframe_key_press_cb() routine in .../gcalctool/gcalctool/gtk.c (about line 2171): fprintf(stderr, "kframe_key_press_cb: keyval: %d state: %d\n", event->keyval, event->state); Recompile and rerun gcalctool, and use your numpad keys and tell me what debug output is generated. I can then add in new keysym/modifier entries for each of the operators that are failing.
From the comments to https://launchpad.net/distros/ubuntu/+source/gcalctool/+bug/33224 it looks like this bug has been fixed in later version(s) of gcalctool. Closing as FIXED.
Sorry for not following up earlier.
No problem.