Bug #486658: [win32] Cannot use period on decimal keypad in my locale

Patch by Sebastien Alborini:

On win32, gdk never sends GDK_KP_Decimal, so this key cannot be detected.
Work around this by watching the underlying virtual keycode VK_DECIMAL.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22101 57a11ea4-9604-0410-9ed3-97b8803252fd
pull/1/head
Christian Stimming 14 years ago
parent cf63a1664f
commit bdb0786dc2

@ -43,6 +43,9 @@
#include "gnc-ui-util.h"
#include "qof.h"
#ifdef G_OS_WIN32
# include <gdk/gdkwin32.h>
#endif
/* Signal codes */
enum
@ -154,6 +157,11 @@ gnc_amount_edit_key_press(GtkWidget *widget, GdkEventKey *event)
GNCAmountEdit *gae = GNC_AMOUNT_EDIT(widget);
gint result;
#ifdef G_OS_WIN32
/* gdk never sends GDK_KP_Decimal on win32. See #486658 */
if (event->hardware_keycode == VK_DECIMAL)
event->keyval = GDK_KP_Decimal;
#endif
if (event->keyval == GDK_KP_Decimal)
{
if (gae->print_info.monetary)

@ -41,6 +41,10 @@
#include "formulacell-gnome.h"
#include "pricecell-gnome.h"
#ifdef G_OS_WIN32
# include <gdk/gdkwin32.h>
#endif
//static QofLogModule log_module = GNC_MOD_REGISTER;
static
@ -68,6 +72,11 @@ gnc_formula_cell_direct_update( BasicCell *bcell,
* this after fixing a bug where one copy was kept up to date, and the
* other not. So, fix this.
*/
#ifdef G_OS_WIN32
/* gdk never sends GDK_KP_Decimal on win32. See #486658 */
if (event->hardware_keycode == VK_DECIMAL)
event->keyval = GDK_KP_Decimal;
#endif
switch (event->keyval)
{
case GDK_Return:

@ -45,6 +45,10 @@
#include "split-register.h"
#include "gnc-engine.h" // For debugging, e.g. ENTER(), LEAVE()
#ifdef G_OS_WIN32
# include <gdk/gdkwin32.h>
#endif
#define DEFAULT_REGISTER_HEIGHT 400
#define DEFAULT_REGISTER_WIDTH 400
/* Used to calculate the minimum preferred height of the register window: */
@ -1885,6 +1889,11 @@ gnucash_sheet_key_press_event (GtkWidget *widget, GdkEventKey *event)
bug#618434
save keyval to handle GDK_KP_Decimal event
*/
#ifdef G_OS_WIN32
/* gdk never sends GDK_KP_Decimal on win32. See #486658 */
if (event->hardware_keycode == VK_DECIMAL)
event->keyval = GDK_KP_Decimal;
#endif
if (sheet->preedit_length)
{
sheet->shift_state = 0;

@ -37,6 +37,9 @@
#include "pricecell.h"
#include "pricecell-gnome.h"
#ifdef G_OS_WIN32
# include <gdk/gdkwin32.h>
#endif
static gboolean
gnc_price_cell_direct_update (BasicCell *bcell,
@ -57,6 +60,11 @@ gnc_price_cell_direct_update (BasicCell *bcell,
is_return = FALSE;
#ifdef G_OS_WIN32
/* gdk never sends GDK_KP_Decimal on win32. See #486658 */
if (event->hardware_keycode == VK_DECIMAL)
event->keyval = GDK_KP_Decimal;
#endif
switch (event->keyval)
{
case GDK_Return:

Loading…
Cancel
Save