Remap System-Level Keybindings #5996
-
Hello everyone! I'm curious if it's possible to override system-level key bindings for the
However, pressing Ctrl+a simply moves the cursor to the start of the input, just as if the terminal itself received it. It looks like the terminal emulator (konsole) intercepts this, so Textual never gets the event.
|
Beta Was this translation helpful? Give feedback.
Answered by
dorianpercic
Jul 28, 2025
Replies: 1 comment 5 replies
-
Where are you defining your bindings? This works for me: from textual.app import App, ComposeResult
from textual.binding import Binding
from textual.widgets import Input
class CustomInput(Input):
BINDINGS = [Binding("ctrl+a", "select_all", "Select All")]
def action_select_all(self) -> None:
self.notify("Select all", title="TODO")
class ExampleApp(App):
def compose(self) -> ComposeResult:
yield CustomInput()
if __name__ == "__main__":
app = ExampleApp()
app.run() |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Alright, thank you very much guys, this works now!