-
Notifications
You must be signed in to change notification settings - Fork 815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate binding ctrl+left_square_brace
#3023
Comments
Just to add that this seems to be the case for all keys with aliases. If you uncomment the binding for from textual.app import App, ComposeResult
from textual.widgets import Footer
class ExampleApp(App):
BINDINGS = [
("ctrl+left_square_brace", "ctrl_left_square_brace", "Miss"),
# ("escape", "escape", "Fires"),
("ctrl+space", "ctrl_space", "Miss"),
# ("ctrl+@", "ctrl_at", "Fires"),
("ctrl+m", "ctrl_m", "Miss"),
# ("enter", "enter", "Fires"),
]
def compose(self) -> ComposeResult:
yield Footer()
def action_ctrl_left_square_brace(self) -> None:
self.bell()
self.notify("You pressed ctrl+left_square_brace")
def action_escape(self) -> None:
self.bell()
self.notify("You pressed escape")
def action_ctrl_space(self) -> None:
self.bell()
self.notify("You pressed ctrl+space")
def action_ctrl_at(self) -> None:
self.bell()
self.notify("You pressed ctrl+@")
def action_ctrl_m(self) -> None:
self.bell()
self.notify("You pressed ctrl+m")
def action_enter(self) -> None:
self.bell()
self.notify("You pressed enter")
if __name__ == "__main__":
app = ExampleApp()
app.run() |
Possibly see also #3563. |
The see-also is more of a "there's other key-binding related things going on here too so do check in there" link than anything else. |
The ctrl_left_square_brace has been named ctrl+space is used as a hotkey to switch languages, at least on macOS, so we can't do much about that. ctrl+m comes through as enter on older terminals, but can be bound on new terminals that support the updated key protocol. Just some legacy terminal weirdness I'm afraid. Not much can be done about it. |
Don't forget to star the repository! Follow @textualizeio for Textual updates. |
It seems we have support for
ctrl+right_square_bracket
andctrl+left_square_brace
. Note that we've called it "bracket" in the first binding, and "brace" in the latter.The bindings for the key alias
ctrl+left_square_brace
also don't seem to fire.Also, it seems that changing the alias brace -> bracket doesn't fix the issue - when the bindings are checked, it seems the alias isn't being used.
Not sure if this is relating to the fact that ESC is an alias of the same key.
Basically, there's something fishy with this binding. It doesn't seem to fire and I don't know what the correct behaviour is -- it needs investigation.
The text was updated successfully, but these errors were encountered: