Menu

#1863 Escape key locks database when menu heading is highlighted

KeePass_2.x
closed
nobody
None
5
2019-09-18
2019-06-07
gbrisbine
No

Good day, all.

I am using v2.42.1 within Windows. The behavior of the escape key within KeePass seems to be contrary to standard Windows behavior. I know the escape key will lock the workspace, which is great. However, if a menu heading is highlighted, the escape key will lock the workspace instead of un-highlighting the menu heading.

Expected behavior:
- If a menu heading is highlighted (for example, press and release Alt key on keyboard to highlight File menu option), I expect pressing the Escape key once will cancel the highlighting of the menu heading.
- You can see this behavior in notepad.exe, iexplore.exe, and regedit.exe. The behavior in Office 2016 is slightly different because of the ribbon, but it still takes two presses of the escape key to fully exit the ribbon after pressing Alt+F.
- Within Windows 10, the behavior in eventvwr.exe and services.exe is slightly different (and may be the new pattern Microsoft is going to). In these applications, pressing Alt+F drops down the File menu, but pressing escape once both closes the File menu and unhighlights the File menu heading (mimicking the behavior of two presses of Esc). The same behavior (one Esc is like 2 Escs) exists in Firefox 66.0.5 and Chrome 74.0.3729.169.

Steps to reproduce:
1. Press Alt+F to drop down File menu
2. Press Escape to cancel drop down of File menu
3. Press Escape to unhighlight File menu heading and KeePass locks

Please let me know if you need any further detail.

Many thanks for an awesome application!

Discussion

  • Paul

    Paul - 2019-06-08

    From a quick glance it is not very obvious that a menu item is highlighted and when you switch away from KeePass with a menu showing, the menu is closed but the main still has focus, so I would expect KeePass to lock in this instance.

    cheers, Paul

     
  • T. Bug Reporter

    T. Bug Reporter - 2019-06-08

    not very obvious that a menu item is highlighted

    It's pretty obvious to me - hit Alt, File lights up. Hit from there, the highlight moves from File to Group. Hit from Group, the Group menu appears, with Add Group... highlighted. Hit Esc in the submenu, the submenu disappears and the highlight moves back to Group. Hit Esc again, and the normal (pre-ribbon) Windows behavior would be to unhighlight Group and move focus back to where it was before hitting Alt - but neither of these things happen. (This is with Options > Interface (tab) > Esc (selection box) set to "Ignore"; I didn't change this from my usual setting before doing this testing.)

    when you switch away

    The OP never mentioned switching away from KeePass, but now that you mention it, I also see a bug there. Switch away with (e.g.) the Group menu open, and on return, focus is back to the main portion of the window, but Group is still highlighted; hit Alt again, highlight goes back to File.


    (reference link - Feature Request: don't react on the ESC key )

     

    Last edit: T. Bug Reporter 2019-06-08
    • gbrisbine

      gbrisbine - 2019-06-10

      Great testing, TBR. As you can tell, mine is configured to lock upon Esc which makes the non-standard menu behavior especially maddening.

       
  • Dominik Reichl

    Dominik Reichl - 2019-08-23
    • status: open --> closed
    • Priority: 7 --> 5
     
  • Dominik Reichl

    Dominik Reichl - 2019-08-23

    I've implemented this now; main menu items can now be deselected by pressing the Esc key.

    Here's the latest development snapshot for testing:
    https://keepass.info/filepool/KeePass_190823.zip

    Menu items still being selected after switching away seems to be a bug in the .NET Framework; KeePass doesn't do any custom handling here.

    Thanks and best regards,
    Dominik

     
  • gbrisbine

    gbrisbine - 2019-09-18

    Thanks for the implementation, Dominik. I can verify that main menu items are deselected when the Esc key is pressed. Thanks again for a great app!

     

Log in to post a comment.