Differentiate keypad keysyms in accelerators

When displaying accelerators, differentiate keypad
symbols with a 'KP' prefix. Fixing a 17 year old bug.

Update expected output in accelerator tests.

Fixes: #227
This commit is contained in:
Matthias Clasen 2020-05-21 18:05:43 -04:00
parent e4d684b116
commit c58d9446f4
2 changed files with 48 additions and 41 deletions

View File

@ -937,6 +937,13 @@ gtk_accelerator_print_label (GString *gstring,
if (seen_mod)
append_separator (gstring);
if (accelerator_key >= GDK_KEY_KP_Space &&
accelerator_key <= GDK_KEY_KP_Equal)
{
g_string_append (gstring, C_("keyboard label", "KP"));
g_string_append (gstring, "");
}
switch (ch)
{
case ' ':

View File

@ -87,13 +87,13 @@ accel2 (void)
static void
accel3 (void)
{
test_one_accel ("KP_7", 0, GDK_KEY_KP_7, "7", TRUE);
test_one_accel ("KP_7", 0, GDK_KEY_KP_7, "KP7", TRUE);
}
static void
accel4 (void)
{
test_one_accel ("<Control>KP_7", GDK_CONTROL_MASK, GDK_KEY_KP_7, "Ctrl+7", TRUE);
test_one_accel ("<Control>KP_7", GDK_CONTROL_MASK, GDK_KEY_KP_7, "Ctrl+KP7", TRUE);
}
static void