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 80139 - pressing KP_Decimal should input the right thing
pressing KP_Decimal should input the right thing
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: GUI
git master
Other All
: Normal enhancement
: ---
Assigned To: Jody Goldberg
Jody Goldberg
: 321282 (view as bug list)
Depends on: 105161
Blocks:
 
 
Reported: 2002-04-28 19:19 UTC by Martin Norbäck
Modified: 2005-11-13 07:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
updated patch. (3.39 KB, patch)
2005-11-12 17:07 UTC, Jean Bréfort
committed Details | Review

Description Martin Norbäck 2002-04-28 19:19:03 UTC
When I press KP_Decimal (decimal separator on the keypad), I always get a
full stop ".". However, when I use Swedish locale, the decimal separator is
a comma ",", and so the input doesn't match.

I find this annoying, Gnumeric should know about KP_Decimal and always
input the right character (given by the locale), so that it's always
possible to input decimal numbers with the keypad.
Comment 1 Andreas J. Guelzow 2002-05-01 19:43:46 UTC
Shouldn't the keyboard mapping take care of this?
Comment 2 Martin Norbäck 2002-05-01 21:09:02 UTC
The keyboard mapping just says that a certain key should be KP_Decimal
or not, it doesn't say what actual character should be emitted when
that key is pressed. That's up to the application to decide.
The application normally calls something like XLookupString and gets a
string from the X server. In this case, however, "KP_Decimal" (as
opposed to "period" or "comma") is returned, and any application which
has special handling of decimal numbers should really treat it as the
decimal separator, no matter what the decimal separator is.
Comment 3 Łukasz Stelmach 2005-10-23 11:56:57 UTC
Let me say "me too" :) However, I think it should be turn-on/off-able option at
an application (Gnumeric) level for I can imagine someone would like to input
some data using the other separator character. Polish locale also uses comma as
a decimal point but I type quite often IP addressess and hate it when the
numeric keypad forces the comma. 
Comment 4 Andreas J. Guelzow 2005-11-12 14:40:22 UTC
*** Bug 321282 has been marked as a duplicate of this bug. ***
Comment 5 Morten Welinder 2005-11-12 16:45:35 UTC
Proposed patch over in bug 321282.
http://bugzilla.gnome.org/attachment.cgi?id=54667&action=view
Comment 6 Morten Welinder 2005-11-12 16:54:35 UTC
Patch needs a little work, IMHO.

format_get_decimal returns a GString* and the length is thus known.
There is no need for the src/widgets/gnumeric-expr-entry.c patch
to call strlen on that.
Comment 7 Jean Bréfort 2005-11-12 17:07:02 UTC
Created attachment 54673 [details] [review]
updated patch.
Comment 8 Jody Goldberg 2005-11-13 02:58:50 UTC
I wrote something similar but somewhat simpler.  However, I am not happy with
the result.  It only handle ExprEntry and the canvas.  It doesn't handle other
entries or spin buttons.

We had what we wanted for a while in gtk itself but it was reverted.  An ideal
solution would be something like a gdk_window_add_filter but at the keyevent
layer.  For now I think we're stuck with something cheesy.

Your approach of manually handling the strings seems somewhat more robust than
my approach of just mapping the keyvals.   Please scale your patch to handle
KP_Separator and commit tommorow for 1.6.1.
Comment 9 Jean Bréfort 2005-11-13 07:35:32 UTC
My solution does not handle other entries or spin buttons either. KP_SEPARATOR
is a synonym of KP_DECIMAL?