mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
input docs an exampels
This commit is contained in:
26
docs/guide/input.md
Normal file
26
docs/guide/input.md
Normal file
@@ -0,0 +1,26 @@
|
||||
# Input
|
||||
|
||||
This chapter will discuss how to make your app respond to input in the form of key presses and mouse actions.
|
||||
|
||||
!!! quote
|
||||
|
||||
More Input!
|
||||
|
||||
— Johnny Five
|
||||
|
||||
## Key events
|
||||
|
||||
The most fundamental way to receive input in via [Key](./events/key) events. Let's take a closer look at key events with an app that will display key events as you type.
|
||||
|
||||
=== "key01.py"
|
||||
|
||||
```python title="key01.py" hl_lines="12-13"
|
||||
--8<-- "docs/examples/guide/input/key01.py"
|
||||
```
|
||||
|
||||
=== "Output"
|
||||
|
||||
```{.textual path="docs/examples/guide/input/key01.py", press="T,e,x,t,u,a,l,!,_"}
|
||||
```
|
||||
|
||||
Note the key event handler which
|
||||
Reference in New Issue
Block a user