ecookbook restoring the folders for testing...
This commit is contained in:
parent
0574702876
commit
9f40a47d30
109 changed files with 0 additions and 0 deletions
13
docs/eCookbook/examples-for-reddit-posts/navigating-focus.md
Normal file
13
docs/eCookbook/examples-for-reddit-posts/navigating-focus.md
Normal file
|
@ -0,0 +1,13 @@
|
|||
## Navigating Focus Using Arrow Keys
|
||||
|
||||
This example shows how you can navigate through your windows's elements by using the left and right arrow keys. The down arrow key is set to exit the program.
|
||||
|
||||
The code that sets up the use of arrow keys are these 3 bind statements. They cause events to be generated when those keys are pressed on the keyboard:
|
||||
```python
|
||||
window.bind('<Right>', '-NEXT-')
|
||||
window.bind('<Left>', '-PREV-')
|
||||
window.bind('<Down>', 'Exit')
|
||||
```
|
||||
|
||||
|
||||
<iframe src='https://trinket.io/embed/pygame/88c7cbc070?start=result' width='100%' height='600' frameborder='0' marginwidth='0' marginheight='0' allowfullscreen></iframe>
|
Loading…
Add table
Add a link
Reference in a new issue