After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 333073 - number pad operator keys not always recognized by gcalctool
number pad operator keys not always recognized by gcalctool
Status: RESOLVED FIXED
Product: gnome-calculator
Classification: Core
Component: general
5.7.x
Other Linux
: Normal normal
: ---
Assigned To: Rich Burridge
Rich Burridge
Depends on:
Blocks:
 
 
Reported: 2006-03-02 01:00 UTC by Daniel Holbach
Modified: 2006-03-28 17:50 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Daniel Holbach 2006-03-02 01:00:20 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.
Comment 1 Rich Burridge 2006-03-02 16:26:53 UTC
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.
Comment 2 Rich Burridge 2006-03-28 17:09:29 UTC
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.
Comment 3 Daniel Holbach 2006-03-28 17:13:41 UTC
Sorry for not following up earlier.
Comment 4 Rich Burridge 2006-03-28 17:50:48 UTC
No problem.