Manually moving from Dev Latest on PC
This commit is contained in:
parent
eb3e21e8d1
commit
c765f1f6f7
4 changed files with 16 additions and 36 deletions
|
@ -1,19 +1,16 @@
|
|||
import PySimpleGUI as sg
|
||||
|
||||
# Recipe for getting a continuous stream of keys when using a non-blocking form
|
||||
# If want to use the space bar, then be sure and disable the "default focus"
|
||||
|
||||
with sg.FlexForm('Realtime Keyboard Test', return_keyboard_events=True, use_default_focus=False) as form:
|
||||
layout = [[sg.Text('Hold down a key')],
|
||||
[sg.SimpleButton('OK')]]
|
||||
with sg.FlexForm("Realtime Keyboard Test", return_keyboard_events=True, use_default_focus=False) as form:
|
||||
layout = [[sg.Text("Hold down a key")],
|
||||
[sg.SimpleButton("OK")]]
|
||||
|
||||
form.Layout(layout)
|
||||
# ---===--- Loop taking in user input --- #
|
||||
|
||||
while True:
|
||||
button, value = form.ReadNonBlocking()
|
||||
|
||||
if button == 'OK':
|
||||
print(button, value, 'exiting')
|
||||
if button == "OK":
|
||||
print(button, value, "exiting")
|
||||
break
|
||||
if button is not None:
|
||||
print(button)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue