data = (PNHMenuWindow) GetWindowLongPtr(hWnd, GWLP_USERDATA);
+ is_accelerator = FALSE;
+ for (i = 0; i < data->menu.size; i++) {
+ if (data->menu.items[i].accelerator == ch) {
+ is_accelerator = TRUE;
+ break;
+ }
+ }
+
+ /* Don't use switch if input matched an accelerator. Sometimes
+ * accelerators can conflict with menu actions. For example, when
+ * engraving the extra choice of using fingers matches MENU_UNSELECT_ALL.
+ */
+ if (is_accelerator)
+ goto accelerator;
+
switch (ch) {
case MENU_FIRST_PAGE:
i = 0;
}
} break;
+ accelerator:
default:
if (strchr(data->menu.gacc, ch)
&& !(ch == '0' && data->menu.counting)) {
return -2;
}
- is_accelerator = FALSE;
- for (i = 0; i < data->menu.size; i++) {
- if (data->menu.items[i].accelerator == ch) {
- is_accelerator = TRUE;
- break;
- }
- }
-
if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')
|| is_accelerator) {
if (data->how == PICK_ANY || data->how == PICK_ONE) {