The register code shouldn't process any keystrokes that have a

"modifier" (e.g. Alt, Meta, etc.) key pressed.  This allows
Alt-Ctl-Pgup/Down in a register to change the notebook page, just like
from the accounts page. Also remove some dead code.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14308 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
David Hampton 2006-06-03 19:58:18 +00:00
parent 7b07c2e238
commit dce5945569
2 changed files with 20 additions and 17 deletions

View File

@ -1,3 +1,11 @@
2006-06-03 David Hampton <hampton@employees.org>
* src/register/register-gnome/gnucash-sheet.c: The register code
shouldn't process any keystrokes that have a "modifier" (e.g. Alt,
Meta, etc.) key pressed. This allows Alt-Ctl-Pgup/Down in a
register to change the notebook page, just like from the accounts
page. Also remove some dead code.
2006-06-03 Andreas Köhler <andi5.py@gmx.net>
* src/gnome-utils/Makefile.am:

View File

@ -1609,8 +1609,16 @@ gnucash_sheet_key_press_event (GtkWidget *widget, GdkEventKey *event)
gnucash_cursor_get_virt (GNUCASH_CURSOR(sheet->cursor), &cur_virt_loc);
new_virt_loc = cur_virt_loc;
/* Don't process any keystrokes where a modifier key (Alt,
* Meta, etc.) is being held down. This should't include
* MOD2, aka NUM LOCK. */
if (event->state & (GDK_MOD1_MASK | GDK_MOD3_MASK |
GDK_MOD4_MASK | GDK_MOD5_MASK))
pass_on = TRUE;
/* Calculate tentative physical values */
switch (event->keyval) {
if (!pass_on) {
switch (event->keyval) {
case GDK_Return:
case GDK_KP_Enter:
g_signal_emit_by_name(sheet->reg, "activate_cursor");
@ -1666,7 +1674,7 @@ gnucash_sheet_key_press_event (GtkWidget *widget, GdkEventKey *event)
case GDK_Down:
case GDK_Menu:
if (event->keyval == GDK_Menu ||
event->state & (GDK_CONTROL_MASK | GDK_MOD1_MASK))
event->state & GDK_CONTROL_MASK)
{
GncItemEdit *item_edit;
@ -1696,22 +1704,9 @@ gnucash_sheet_key_press_event (GtkWidget *widget, GdkEventKey *event)
return TRUE;
pass_on = TRUE;
/* This is a piece of logic from gtkentry.c. We
are trying to figure out whether to change the
selection. If this is a regular character, we
don't want to change the selection, as it will
get changed in the insert callback. */
if ((event->keyval >= 0x20) && (event->keyval <= 0xFF))
{
if (event->state & GDK_CONTROL_MASK)
break;
if (event->state & GDK_MOD1_MASK)
break;
}
break;
}
}
}
/* Forward the keystroke to the input line */
if (pass_on)