MCPcopy Index your code
hub / github.com/PySimpleGUI/PySimpleGUI / _ReturnKeyHandler

Method _ReturnKeyHandler

PySimpleGUI/PySimpleGUI.py:1289–1307  ·  view source on GitHub ↗

Internal callback for the ENTER / RETURN key. Results in calling the ButtonCallBack for element that has the return key bound to it, just as if button was clicked. :param event: :type event:

(self, event)

Source from the content-addressed store, hash-verified

1287 return
1288
1289 def _ReturnKeyHandler(self, event):
1290 """
1291 Internal callback for the ENTER / RETURN key. Results in calling the ButtonCallBack for element that has the return key bound to it, just as if button was clicked.
1292
1293 :param event:
1294 :type event:
1295
1296 """
1297 # if the element is disabled, ignore the event
1298 if self.Disabled:
1299 return
1300
1301 MyForm = self.ParentForm
1302 button_element = self._FindReturnKeyBoundButton(MyForm)
1303 if button_element is not None:
1304 # if the Button has been disabled, then don't perform the callback
1305 if button_element.Disabled:
1306 return
1307 button_element.ButtonCallBack()
1308
1309 def _generic_callback_handler(self, alternative_to_key=None, force_key_to_be=None):
1310 """

Callers

nothing calls this directly

Calls 2

ButtonCallBackMethod · 0.80

Tested by

no test coverage detected