Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow control over, or disablement of, the "action" keys: Enter, Return, and Escape. #125

Closed
bradtchapman opened this issue May 24, 2022 · 6 comments
Assignees
Labels
enhancement New feature or request in progress

Comments

@bradtchapman
Copy link

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.

@bradtchapman bradtchapman changed the title Allow control or disablement over the Enter, Return, and Escape keys. Allow control over, or disablement of, the "action" keys: Enter, Return, and Escape. May 24, 2022
@bartreardon bartreardon self-assigned this May 24, 2022
@bartreardon bartreardon added the enhancement New feature or request label May 24, 2022
@bartreardon
Copy link
Collaborator

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.

@mm2270
Copy link

mm2270 commented Jun 8, 2022

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.

@bradtchapman
Copy link
Author

@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?

@bartreardon
Copy link
Collaborator

everything is now v2.0 roadmap (except for killer bugs in 1.11.2 if one does get reported)

@BigMacAdmin
Copy link
Collaborator

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!

@milkerson
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request in progress
Projects
None yet
Development

No branches or pull requests

5 participants