swiftDialog
swiftDialog copied to clipboard
Allow control over, or disablement of, the "action" keys: Enter, Return, and Escape.
To prevent a user from quickly dismissing dialog by pressing Escape or Return/Enter, or in the case that the dialog appears while they are in the middle of typing something very important, please allow an administrator to disable the use of these keys while dialog is active.
Also suggest an optional argument for these switches to disable them for just a few seconds.
Suggested switches:
--disableReturnKey [seconds] --disableEnterKey [seconds] --disableEscapeKey [seconds]
Optional parameter, in seconds. If none given, it shall be forever until the app is closed.
--disableReturnKey 5
More stringent: disable ALL keyboard input for the app.
--keyboardDisable [seconds]
And consider making a bypass for the special exit key, or require an admin to set one otherwise the dialog can only be quit using Activity Monitor / kill -9.
so I've been having a think about this one.
the return key can be effectively disabled with --button1disabled. You can then re-enable after whatever time you specify with echo "button1: enable" >> /var/tmp/dialog.log in your calling script.
the escape key won't be available if button 2 is not being shown so if you don't want people to hit escape, don't show button 2.
I'm just thinking of the use case where you would want the cancel button visible but not actionable with the escape key.
I could see the importance of being able to disable the Enter/Return key, since I can imagine an edge scenario where someone is typing and hitting Return to start a new paragraph just as a dialog appears and they could accidentally dismiss the dialog before being able to read it.
However, I agree with you that disabling the Escape key is less important. While I can see a scenario where you want the Escape / Cancel button to show, but don't want someone accidentally invoking it, the situations where that can happen accidentally seem very small. Sure, maybe if the stars and moon align just right it can happen, but it hardly seems worth worrying about it.
@bartreardon : disabling button 1 is fine — this stops [Return], [Enter], and even [Space] as accidental keystrokes to close the dialog box by pressing the button.
@mm2270 : as for the escape key, I'm thinking about a power user who is used to pressing [Esc] to reflexively dismiss dialogs that 'get in their way' when they're focused... but we need them to read something important.
Has this been pushed back to the v2.0 roadmap?
everything is now v2.0 roadmap (except for killer bugs in 1.11.2 if one does get reported)
Yo, I just wanted to bump this and ask about the status since 2.0 released but I don't see any documentation about it. Thanks, Bart!
Also want to bump this.
My scenario is that I am assigning button2 to an action that is secondary, but does something critical. I am trying to avoid the "accidental" or "reflexive" pressing of [Esc] to dismiss the window. I do want button2 to be clickable, however.
For now I'll experiment with a time delay and see if that can discourage a majority of folks looking for ways around it.