questionary icon indicating copy to clipboard operation
questionary copied to clipboard

It would be good to be able to set the "Finish" key combo for the Text input.

Open garyrob opened this issue 1 year ago • 2 comments

Describe the problem

On MacOS, a text input area is usually exited when the user presses Return. It's pretty standard for option-Return to mean: "I don't want to exit; instead, I just want to enter a newline character".

But in a Questionary Text input, it says to use "Alt-Enter" to finsih. On the Mac keyboard, that translates to option-Return.

This violates muscle memory on a Mac, since a Mac user is used to using that combination to mean he does NOT want to finish, but instead just wants to enter a newline.

Describe the solution

It would be great if there was a way to set the key combination that would mean "just enter a newline" and the key combination that would mean "Finish". On a Mac, the latter would normally be just Return.

Alternatives considered

Leaving as-is is one alternative. As mentioned, that violates muscle on a mac.

Another alternative would be for the behavior on a mac to be different from other platforms. You could have the behavior default to "option-Return" to enter a newline, and Return to Finish.

I'm not sure, however, whether there are similar considerations for Linux or other Unixes. So I suggest just letting the programmer set the key combos. But if you could figure out what the key combos should be on each platform, in order to be intuitive on each one, that would be another good solution.

garyrob avatar Jul 04 '23 12:07 garyrob

After writing the above, I realized that if one of the suggested changes were to be made, the instructions to the user (currently "(Finish with 'Alt+Enter' or 'Esc then Enter')") would also have to be programmable by the developer or set to platform-specific values. Just thought it was worth mentioning.

garyrob avatar Jul 04 '23 12:07 garyrob

Additionally, on my mac in the PyCharm terminal, neither option+enter nor Esc then Enter work for me.

jstrunk avatar Jul 25 '24 18:07 jstrunk