mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
dispatch kehy
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from textual.app import App
|
||||
from textual import events
|
||||
from textual.widgets import Placeholder
|
||||
from textual.widget import Widget
|
||||
from textual import events
|
||||
|
||||
|
||||
class BasicApp(App):
|
||||
@@ -16,6 +16,9 @@ class BasicApp(App):
|
||||
sidebar=Widget(),
|
||||
)
|
||||
|
||||
async def on_key(self, event: events.Key) -> None:
|
||||
await self.dispatch_key(event)
|
||||
|
||||
def key_a(self) -> None:
|
||||
self.query("#footer").set_styles(text="on magenta")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user