Menu

#2112 ESC to hide KeePass

KeePass_2.x
closed
nobody
None
5
2018-05-10
2016-03-24
Ruslan
No

Hello,

I didn't find an option to hide the KeePass 2.x window by ESC key. Is there a such posibility or a plugin?

Discussion

  • Paul

    Paul - 2016-03-24

    There is no option for this at present.

    cheers, Paul

     
  • Peter Paluska

    Peter Paluska - 2016-04-11

    A CheckBox at Options/Integration would be right for this feature?

     
  • Ruslan

    Ruslan - 2016-04-11

    I think so. Thank you, it very useful feature.

     
  • Dominik Reichl

    Dominik Reichl - 2016-04-14
    • status: open --> closed
     
  • Dominik Reichl

    Dominik Reichl - 2016-04-14

    This has been implemented; pressing the Escape key (Esc) in the main window now locks the workspace (and the options 'Always exit instead of locking the workspace' and 'Minimize main window after locking the workspace' can be turned on to "hide" the window).

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

    Thanks and best regards,
    Dominik

     
  • Ruslan

    Ruslan - 2016-04-15

    Thank you. Some suggestions:
    1) Why lock the workspace by Esc? It's just a hiding the window operation, imo. Moreover, if just minimize the window this operation will be inspected by the existing 'Lock workspace when minimizing main window' setting or/and 'Always exit instead of locking the workspace' later (after the 'hiding by Esc' operation) on. IMO, it's enough to add the 'Hide main window by Esc' setting checkbox as it quite boring to reenter the password when window was hidden by Esc.
    2) The 'Always exit instead of locking the workspace' and 'Exit instead of locking the workspace after the specified time' are confuzing and interchangable for me. I would keep only 'Exit when workspace is locked' to exit when the workspace has been locked by some of the setting.

     
  • Dominik Reichl

    Dominik Reichl - 2016-04-16

    1) In the main windows of major applications (by that I mean popular browsers, Office solutions, Visual Studio, applications built-in to Windows, etc.), pressing Esc has no effect. Especially, Esc typically does not minimize or close the main window, even though these are operations supported by most applications.

    As there's no standard behavior for Esc in this situation, we can assign one freely. There already are multiple ways for minimizing the main window (e.g. pressing Win+DownArrow), so I don't think we need another way for this. In contrast, locking the workspace is a new command (it differs from Ctrl+L). To me, locking the workspace when pressing Esc feels natural (and this also is how Esc works in KeePass 1.x). But this of course is subjective; to you, minimizing without locking may be the expected behavior. However, simply minimizing the window on escaping also would be a bit dangerous; as Esc typically is used to close modal dialogs or cancel operations, users might assume that the KeePass database is safely closed after Esc and may be surprised if this is not the case.

    So, I'll leave it as it is; Esc locks the workspace. If you want to just minimize the main window (without locking; maybe together with the option 'Minimize to tray instead of taskbar'), use one of the existing keyboard shortcuts for this.

    2) The options are not interchangable. The first one applies always when locking, whereas the second one only applies when a timeout occurs, and it is intended to allow a different behavior here.

    Best regards,
    Dominik

     
  • Ruslan

    Ruslan - 2016-05-17

    For those who don't want to lock the KP when Escape is pressed, in the sources\KeePass\Forms\MainForm_Functions.cs\bool ProcessCmdKey(ref Message msg, Keys keyData) replace:

    if(obKeyDown.Value) LockAllDocuments();

    with

    if(obKeyDown.Value) MinimizeToTray(true);

    recompile and replace your KeePass.exe.

     
  • Matias

    Matias - 2016-05-18

    Hi guys!

    I agree with Dominik that this should be KP default behavior, relating ESC, since there are many amateur users.

    However, I´m also with you, Ruslan, about the necessity of having and option to make ESC minimize KP, for advanced users: after many years of minimizing to tray this way, the last KP version is driving me mad!

    Unfortunately, I don´t have the knoledge to compile the above code. Would you be so kind, since Dominik doesn´t seem to want to include such option, to make your modified exe available (I know the security risks and all...)? If not, I´ll be forced to go back to the previous KP version!

    Thank you very much guys!

    Matias.

     

    Last edit: Matias 2016-05-18
  • Ruslan

    Ruslan - 2016-05-18

    No problem, attached, it is v2.33. It is not changed in any way, but I can't prove it of course, use it on your own risk.
    BTW, it is not hard to compile it, just install the free Visual Studio Express or Community, change the specified file and recompile.

     
    • Matias

      Matias - 2016-05-19

      Thank you!

       
  • Dominik Reichl

    Dominik Reichl - 2016-05-19

    Matias, how did you get KeePass to minimize to tray when pressing Esc in KeePass 2.32 and earlier? Up to 2.32, pressing Esc simply did nothing. Is there a plugin that added behavior to Esc?

    Best regards,
    Dominik

     
  • Dominik Reichl

    Dominik Reichl - 2016-05-19

    I've now added an option 'Esc minimizes to tray instead of locking the workspace' (in 'Tools' -> 'Options' -> tab 'Interface'). For safety, it's turned off by default (i.e. Esc locks the workspace).

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

    I'd still be interested how you achieved minimization to tray in KeePass 2.32 and earlier, because I fear that there's now a conflict with a plugin.

    Ruslan, to avoid confusion I've deleted your custom build (it basically does the same as the new option); hope you don't mind :-)

    Thanks and best regards,
    Dominik

     
    • Matias

      Matias - 2016-05-19

      Thank you for the new version, Dominik!

      Now KeeOtp.plgx shows as "not compatible". Is there anything that can be done to solve this?

      PS: Actually, you are right, the last version I had installed didn´t minimize to tray, sorry for the confusion!

       

      Last edit: Matias 2016-05-19
  • Ruslan

    Ruslan - 2016-05-19

    Thank you, Dominik, now I don't need to recompile each new version.

     
  • Moore Bailey

    Moore Bailey - 2016-07-11

    Such feature was useful to me, long I looked for. Thanks.

     
  • Chris Papademetrious

    Logged in to say thank you for the ESC-to-minimize feature!

     

Log in to post a comment.

MongoDB Logo MongoDB