-
Is it possible to disable app key bindings, and keep only specific screen bindings when it's active? In my case, I have an app, which uses hot keys to navigate across screens (a.k.a. text tabs). Each screen has dedicated bindings for operations and to close it. However, after screen pop up the app is handling global bindings, but I'd like to allow only use to back to the main screen and disallow global bindings. Footer widget also gets cluttered for a child screens because also contains app bindings. Any suggestions? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Likely your best approach here is to not bind those keys on the app, and to not use the default screen as your main screen. Instead supply your own main screen and bind the keys on that. See https://textual.textualize.io/blog/2022/11/26/on-dog-food-the-original-metaverse-and-not-being-bored/#dont-use-the-default-screen for example. |
Beta Was this translation helpful? Give feedback.
-
@davep thanks, actually having an explicit main screen makes much more sense and clarity in the code. Possibly this should be crystallized as a best practice recommendation in documentation down the road. |
Beta Was this translation helpful? Give feedback.
Likely your best approach here is to not bind those keys on the app, and to not use the default screen as your main screen. Instead supply your own main screen and bind the keys on that.
See https://textual.textualize.io/blog/2022/11/26/on-dog-food-the-original-metaverse-and-not-being-bored/#dont-use-the-default-screen for example.