As of 0.6.0, bindings on (at least) `left`, `right`, `up` and `down` no longer appear to work
See original GitHub issueWith Textual 0.5.0 I had bindings on the arrow keys that worked fine. Having upgraded to 0.6.0 those bindings no longer seem to work. Isolating the issue I can recreate with this code (some other keys thrown in as control tests)
from textual.app import App, ComposeResult
from textual.widgets import TextLog, Header, Footer
from textual.binding import Binding
from textual.events import Key
class Binder( App[ None ] ):
CSS = """
TextLog {
background: #222200;
color: #BBBB00;
text-style: bold;
}
"""
BINDINGS = [
Binding( "up", "log( 'up' )", "Up" ),
Binding( "down", "log( 'down' )", "Down" ),
Binding( "left", "log( 'left' )", "Left" ),
Binding( "right", "log( 'right' )", "Right" ),
Binding( "a", "log( 'a' )", "a" ),
Binding( "s", "log( 's' )", "s" ),
Binding( "d", "log( 'd' )", "d" ),
Binding( "f", "log( 'f' )", "f" ),
Binding( "left_square_bracket", "log( '[' )", "[" ),
Binding( "right_square_bracket", "log( ']' )", "]" ),
]
def compose( self ) -> ComposeResult:
yield Header()
yield TextLog()
yield Footer()
def on_mount( self ) -> None:
self.query_one( TextLog ).write( "Ready..." )
self.query_one( TextLog ).write( "Key bindings being looked for:" )
self.query_one( TextLog ).write( ", ".join(
[ binding.key for binding in self.BINDINGS ]
) )
def action_log( self, name: str ) -> None:
self.query_one( TextLog ).write( f"Via binding: {name}" )
def on_key( self, event: Key ) -> None:
self.query_one( TextLog ).write( f"Via event: {event!r}" )
if __name__ == "__main__":
Binder().run()
Running the above, pressing the arrow keys vs some of the other keys…
Issue Analytics
- State:
- Created 9 months ago
- Comments:21 (19 by maintainers)
Top Results From Across the Web
Add support for a `PRIORITY_BINDINGS` classvar to work ...
For now this is just a draft PR as I work to build up a set of ... As of 0.6.0, bindings on...
Read more >Re: [RELEASED] MaxVR Oculus Rift Video Player - DK...
NEW: Added key bindings to goto next / prev file in currently used directory. Fixed: Video Filenames with "SBS" "_LR" or "OU" "_TB"...
Read more >Set up your ski binding correctly! - YouTube
It's really important taht your skibinding is set correctly to your ski boot. It is a simpel thing to do, and all you...
Read more >How To: Binding Adjustment - YouTube
This video explains how to adjust Atomic Device 310 ski bindings. The concepts explained can be applied to any bindings.
Read more >kitty.conf - Kovid Goyal
To get a full list of supported fonts use the kitty +list-fonts command. ... which in that font changes the appearance of the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
They are the same thing for the base class, and most widgets. But it is possible for something to be scrollable that is not a container. I think the only one we have is
ScrollView
.Don’t forget to star the repository!
Follow @textualizeio for Textual updates.