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

bpo-44942: Add numberpad enter bind to TK's simpleDialog #27498

Closed
wants to merge 1 commit into from

Conversation

Electro707
Copy link

@Electro707 Electro707 commented Jul 30, 2021

This is a trivial PR that binds the numberpad enter button to self.ok in simpleDialog's Dialog class, as Tk treats that the number-pad enter and the main-enter buttons separately.

https://bugs.python.org/issue44942

@Electro707 Electro707 changed the title bpo-NNNN: Added numberpad enter bind to TK's simpleDialog bpo-27498: Added numberpad enter bind to TK's simpleDialog Jul 30, 2021
@gvanrossum
Copy link
Member

gvanrossum commented Jul 31, 2021

That is not the right bpo number.

@Electro707 Electro707 changed the title bpo-27498: Added numberpad enter bind to TK's simpleDialog bpo-xxxxx: Added numberpad enter bind to TK's simpleDialog Aug 1, 2021
@Electro707
Copy link
Author

Electro707 commented Aug 1, 2021

That is not the right bpo number.

Sorry about this. This PR doesn't have an issue/bug related to it as it's trivial.

@nightlark
Copy link
Contributor

nightlark commented Aug 18, 2021

That is not the right bpo number.

If this change isn't considered something that can be labeled as skip issue, I'm willing to create an issue for it to get practice using the tracker.

@gvanrossum
Copy link
Member

gvanrossum commented Aug 18, 2021

That is not the right bpo number.

If this change isn't considered something that can be labeled as skip issue, I'm willing to create an issue for it to get practice using the tracker.

Sounds like a plan. Go for it!

@nightlark
Copy link
Contributor

nightlark commented Aug 18, 2021

Here is an issue for this PR in the bug tracker: bpo-44942

@ned-deily ned-deily changed the title bpo-xxxxx: Added numberpad enter bind to TK's simpleDialog bpo-44942: Added numberpad enter bind to TK's simpleDialog Aug 18, 2021
Copy link
Member

@gvanrossum gvanrossum left a comment

I'd like our resident IDLE dev, @terryjreedy, have a peek at this. Maybe the intended way to do this would be for the app to add the binding? Or, alternatively, we should do this throughout tkinter whenever <Return> is bound to an "OK" or "default" button? I notice plenty of <Return> elsewhere in tkinter but no <KP_Enter>. I don't have a keyboard with a separate keypad so I can't easily test what other things (built with Tcl/Tk or not) do.

@nightlark
Copy link
Contributor

nightlark commented Aug 18, 2021

For the behavior of other things on Windows (not built with Tcl/Tk) -- system dialog boxes all behave same way regardless of which enter key is pressed, as does any place with text entry/dialog box buttons on the major browsers and powershell/wsl/bash/putty prompts on Windows. Selecting a drop-down menu option using arrow keys+enter also works with either enter key.

@python python deleted a comment from the-knights-who-say-ni Aug 18, 2021
@terryjreedy terryjreedy changed the title bpo-44942: Added numberpad enter bind to TK's simpleDialog bpo-44942: Add numberpad enter bind to TK's simpleDialog Aug 18, 2021
@terryjreedy
Copy link
Member

terryjreedy commented Aug 19, 2021

The patch is fine in itself, but I am dubious about the intended change. It is not needed on Windows and perhaps wrong elsewhere. See my msg399879 post on the issue. If the issue is rejected, this would be closed.

@Electro707
Copy link
Author

Electro707 commented Aug 20, 2021

Closing this PR due to the discussion over at bpo-44942.
I did not realize that Window's simpleDialogs had the numberpad enter key binded and the lack of it was a unix only thing. I do agree in this case to keep it as is, and if someone wants it they could create a child class and add the binding there(as I've done on one of my projects).

Thanks for all your help and discussion!

@Electro707 Electro707 closed this Aug 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants