Opened 3 years ago

Closed 12 months ago

#313 closed defect (fixed)

Need to disable keyboard accelerators Shift-Home and Shift-End when focus is in a toolbar input field

Reported by: lewisr Owned by: gyoung
Priority: major Milestone: 1.4.1
Component: Lucide Core Version: 1.3.6
Keywords: Cc:

Description (last modified by lewisr)

When clicking in the page number dialog in the toolbar for a lengthy document, it is expected to be able to highlight the entire page number (e.g., 1200) with Shift-Home. Unfortunately, we grab that key combination and jump to the first supported document in the directory, leaving the current document.

We should disable these accelerators when in that box, so that we do not lose the current document.

Change History (10)

comment:1 Changed 3 years ago by lewisr

  • Description modified (diff)

comment:2 Changed 3 years ago by lewisr

To clarify, the View | Go to page... dialog works correctly in this regard. It is just the toolbar page input box which does not.

comment:3 Changed 3 years ago by gyoung

The accelerator keys function for the entire main window. It would be probably difficult to turn them off for the toolbar. Might be able to load an acceltable for the toolbar but don't know what that would do. The other alternative is change the keys. ALT is available for these.

comment:4 Changed 3 years ago by lewisr

  • Summary changed from Need to disable keyboard accelerators Shift-Home and Shift-End when focus is in a dialog to Need to disable keyboard accelerators Shift-Home and Shift-End when focus is in a toolbar input field

I don't know that we want to change the keys, either.

lucide.cpp has this comment:

change the accel logic by first letting the focus window process WM_CHAR and only translate it to accel if not handled (this makes sure that standard keyboard shortcuts in e.g. input fields work even if we define our own accelerators from these shortcuts in the main window). Make an exception for VK_TAB since it's always eaten by the standard window procedure and therefore the accel table will never be called. Note that we do this trick only for the document window and its children: other windows such as the standard frame controls like menu etc. are known to demonstrate weird behavior (for example, the menu window seems to exit the menu mode on any WM_CHAR sent to it)

If you look at the section which follows, (near line 1311), I wonder if we could OR that to include the toolbar.

comment:5 Changed 3 years ago by gyoung

I don't think we can do this. I emailed Steven about it and he doesn't have a good solution. If this is important and the other related tickets are important we should change these to control shift and document it so they are not in conflict.

Last edited 3 years ago by gyoung (previous) (diff)

comment:6 Changed 3 years ago by lewisr

Are you suggesting that we assign Ctrl-Shift-Home and Ctrl-Shift-End to beginning/end of the toolbar input field, and leave Shift-Home and Shift-End for scrolling the document itself from top to bottom? If so, then ignore my last email concerning closing this as won't fix. This seems like a reasonable solution.

comment:7 Changed 15 months ago by gyoung

  • Milestone changed from 1.4.0 to 1.4.1

Ticket retargeted after milestone closed

comment:8 Changed 14 months ago by gyoung

Currently this is what these keys do

VK_HOME, CM_FILEFIRST, VIRTUALKEY, SHIFT
VK_PAGEUP, CM_FILEPREVIOUS, VIRTUALKEY, SHIFT
VK_PAGEDOWN, CM_FILENEXT, VIRTUALKEY, SHIFT
VK_END, CM_FILELAST, VIRTUALKEY, SHIFT

VK_PAGEDOWN, CM_NEXTPAGE, VIRTUALKEY, CONTROL
VK_PAGEUP, CM_PREVPAGE, VIRTUALKEY, CONTROL
VK_END, CM_LASTPAGE, VIRTUALKEY, CONTROL
VK_HOME, CM_FIRSTPAGE, VIRTUALKEY, CONTROL

Both sets work exactly as described everywhere in the main window including the page input box and the document window.

I have changed

VK_HOME, CM_FILEFIRST, VIRTUALKEY, SHIFT
VK_PAGEUP, CM_FILEPREVIOUS, VIRTUALKEY, SHIFT
VK_PAGEDOWN, CM_FILENEXT, VIRTUALKEY, SHIFT
VK_END, CM_FILELAST, VIRTUALKEY, SHIFT

to

VK_HOME, CM_FILEFIRST, VIRTUALKEY, SHIFT, CONTROL
VK_PAGEUP, CM_FILEPREVIOUS, VIRTUALKEY, SHIFT, CONTROL
VK_PAGEDOWN, CM_FILENEXT, VIRTUALKEY, SHIFT, CONTROL
VK_END, CM_FILELAST, VIRTUALKEY, SHIFT, CONTROL

This makes SHIFT+HOME work as you want in the page number box but it also changes this everywhere in the document window. Is this what you want? I don't use the hot keys so I don't care.

Note the current SHIFT combinations toggle through files. It is the Control combinations that have always done the page scrolling.

I could also make the CONTROL combinations toggle through the files and just eliminate the SHIFT combinations since Home, End, PgDn?, PgUp? by themselves navigate through the document.

comment:9 Changed 14 months ago by gyoung

  • Owner set to gyoung
  • Status changed from new to assigned

comment:10 Changed 12 months ago by lewisr

  • Resolution set to fixed
  • Status changed from assigned to closed

Updated English message file to reflect new file accelerators (Ctrl+Shift+<key>). r689

Note: See TracTickets for help on using tickets.