GNOME Bugzilla – Bug 618434
Decimal separator is always '.' when using the keypad
Last modified: 2018-06-29 22:39:15 UTC
My locale (nl_BE) uses ',' as the decimal separator character. When testing r19134 with some real data, I noticed GnuCash no longer enters ',' when using the numeric keypad of my keyboard. Instead it enters a '.' This is not due to something that changed on my system though, because when I use GnuCash 2.2.9, this still works fine. I haven't investigated this deeper yet, but perhaps this is related to the register changes in bug #605802 ?
I have run some tests. The problem is first introduced in r18713, which is effectively the first revision to start fixing bug 605802 (not counting the the attempt that got reverted). So I'm pretty sure this issue is introduced as a result of the patches for bug 605802. I've taken the liberty to add Yasuaki Taniguchi to the cc list of this bug, so he is informed of this problem.
I'd like to know which type of keyboards you use in order to distinguish what xkb event is generated when you type ',' key at a numeric keypad. Because my keyboard (Sun Type 6 US) don't have ',' key in numeric keypad, I can't generate it in my environment right now. If you are using Linux, the proper names of keyboards are defined in /usr/share/X11/xkb/keymap/xfree86. Would you tell me which one you use?
My keyboard is "be" (from Belgian) according to this file. Thank you for taking this up.
I found the Belgian keyboard layout at wikipedia. http://en.wikipedia.org/wiki/AZERTY Section: Differences between the Belgian and French layouts of the AZERTY keyboard http://en.wikipedia.org/wiki/File:Azerty_fr.svg It seem that the key of decimal is labeled a period, not a comma. Do you mean a `comma' should be inserted when you press a `period' numeric key? According to "be", "latin" and "keypad" files at /usr/share/X11/xkb/symbols/, KP_Decimal event is generated when a numeric decimal key is pressed. So I can fix this regression.
That is correct. There is a '.' printed on the keyboard, but Belgium as several other European countries uses ',' as decimal separator. I suppose the solution is indeed to output whatever the selected locale's decimal separator symbol is when typing that key on the keypad. To make things slightly more complicated, most applications on my system type a ',' when in a numeric context and a '.' when in other contexts. For GnuCash that would mean * when I am entering a transaction description, the '.' key on my numpad would generate a '.' * when entering an amount, the same key would generate a ','. I'm afraid I don't know how that magic works, but it's pretty convenient.
Created attachment 162427 [details] [review] decimal regression fix patch This patch fixes this regression. Gtk's IMContext is not intuitive. In spite of disconnecting IM, gtk's IMContext consumes and convert most of keypress events into single byte string for commitment. So It is necessary to save keyevent before gtk_im_context_filter_keypress(), and restore it after it's commit callback function. I tested this patch on Linux with LANG=ja,en,nl,de. I also tested on Windows with LANG=ja. But I don't test on other language environments because I don't have them.
Review of attachment 162427 [details] [review]: r19222
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=618434. Please update any external references or bookmarks.