Skip to content

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

Closed
Electro707 wants to merge 1 commit intopython:mainfrom
Electro707:number_enter_dialog
Closed

bpo-44942: Add numberpad enter bind to TK's simpleDialog#27498
Electro707 wants to merge 1 commit intopython:mainfrom
Electro707:number_enter_dialog

Conversation

@Electro707
Copy link
Copy Markdown

@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
Copy Markdown
Member

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
Copy Markdown
Author

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
Copy Markdown
Contributor

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
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy Markdown
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
Copy Markdown
Member

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
Copy Markdown
Author

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.

6 participants