Skip to content
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

Adding additional bindings for widget.Input #1001

Closed
JoshPaulie opened this issue Oct 24, 2022 · 4 comments
Closed

Adding additional bindings for widget.Input #1001

JoshPaulie opened this issue Oct 24, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@JoshPaulie
Copy link

JoshPaulie commented Oct 24, 2022

Opening up dialog to discuss possible widget.Input bindings. I'd be happy to implement them, and already have a few on my local fork

Proposed action and accompanying shortcut

  • Clear line ✅
    • Shift+Delete (up for debate)
  • Backspace (Word at a time)
    • Ctrl+Backspace
  • Delete forward (Word at a time)
    • Ctrl+Delete
  • Move Cursor (Word at a time) ✅
    • Ctrl+Left
    • Ctrl+Right

Besides the clear line action, "these are universal shortcuts."

There's a discussion to be had here regarding what we consider universal to be. Are we treating widget.Input like we might an html input box? If so, the proposed shortcuts would qualify.

@JoshPaulie
Copy link
Author

While trying to implement ctrl+backspace, I noticed an interesting interaction with widget.Input

  • Any unbound bindings (key combinations) have no effect on Input
    • For example, ctrl+left does nothing bc it doesn't have a binding action.
  • This is not the case with backspace though. ctrl+backspace and shift+backspace are functionally the same as backspace

@davep davep added the enhancement New feature or request label Jan 11, 2023
@liancheng
Copy link

+1 for adding extra bindings. I think the Emacs-style key bindings are pretty much the standard in macOS and Linux systems. Text input widgets in almost all GUI programs support that. Would be great to support a subset of this cheatsheet: https://readline.kablamo.org/emacs.html

@davep
Copy link
Contributor

davep commented Feb 27, 2023

(Just checking some older issues) Many more actions and bindings were added to Input in 0.11.0.

@davep davep closed this as completed Feb 27, 2023
@github-actions
Copy link

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants