[Tutor] What does 'Bind Return Key' do?

Peter Otten __peter__ at web.de
Mon Apr 29 03:23:49 EDT 2019


Matthew Polack wrote:

> Hi,
> 
> We're learning Python with PySimpleGUi and have used this example
> program...
> 
> 
https://github.com/PySimpleGUI/PySimpleGUI/blob/master/ProgrammingClassExamples/Win10%20versions/1d%20PSG%20(named%20input%20keys%20and%20catch%20errors).py
> 
> 
> There is a mystery command that says:
> 
> [sg.ReadButton('Submit', bind_return_key = False)]]
> 
> If I change this 'Bind_Return_Key' value from False to True...or in fact
> delete it entirely, it appears to make do difference whatsoever to the
> functioning of the program that I can see...
> 
> Could someone explain what the purpose of this could be? I'm guessing it
> has to have a reason to be there!

With

bind_return_key=True

hitting the <return> key has the same effect as clicking on the [Submit] 
button.



More information about the Tutor mailing list