[GH-ISSUE #820] Add Ctrl-P up() and Ctrl-N down() support #597

Closed
opened 2026-03-04 01:06:20 +03:00 by kerem · 3 comments
Owner

Originally created by @convto on GitHub (Mar 4, 2023).
Original GitHub issue: https://github.com/rivo/tview/issues/820

In Emacs and similar editors, Ctrl-P/Ctrl-N is equivalent to arrow up/arrow down.
I am familiar with such shortcuts and would like to add support for this if possible.

I have checked the code for this project and it does not have critical interference with existing shortcuts,
Ctrl-P/Ctrl-N are only used in demos.

And Ctrl-P/Ctrl-N support would be possible to add by adding tcell.KeyCtrlP or tcell.KeyCtrlN to the part that detects the arrow key input, like this:
github.com/rivo/tview@db36428c92/table.go (L1590-L1593)

If maintainers agree with this opinion, I will try to create a patch.

Thanks for making an awesome project!

Originally created by @convto on GitHub (Mar 4, 2023). Original GitHub issue: https://github.com/rivo/tview/issues/820 In Emacs and similar editors, Ctrl-P/Ctrl-N is equivalent to arrow up/arrow down. I am familiar with such shortcuts and would like to add support for this if possible. I have checked the code for this project and it does not have critical interference with existing shortcuts, Ctrl-P/Ctrl-N are only used in [demos](https://github.com/rivo/tview/blob/ae9464cc3598d81fff6813af3e28f292a9de6c15/demos/presentation/main.go#L89-L95). And Ctrl-P/Ctrl-N support would be possible to add by adding `tcell.KeyCtrlP` or `tcell.KeyCtrlN` to the part that detects the arrow key input, like this: https://github.com/rivo/tview/blob/db36428c92d90d1bea934451c4f78bba88058854/table.go#L1590-L1593 If maintainers agree with this opinion, I will try to create a patch. Thanks for making an awesome project!
kerem closed this issue 2026-03-04 01:06:20 +03:00
Author
Owner

@rivo commented on GitHub (Mar 4, 2023):

No need for a patch. You can use SetInputCapture to customize your key binds.

<!-- gh-comment-id:1454780203 --> @rivo commented on GitHub (Mar 4, 2023): No need for a patch. You can use [`SetInputCapture`](https://pkg.go.dev/github.com/rivo/tview#Box.SetInputCapture) to customize your key binds.
Author
Owner

@convto commented on GitHub (Mar 5, 2023):

I thought if I could add Ctrl-P/Ctrl-N support to the master branch it would save me some future work,
but the library has designs and policies, so I'll follow your guide!

Thanks for answering!

<!-- gh-comment-id:1454969426 --> @convto commented on GitHub (Mar 5, 2023): I thought if I could add Ctrl-P/Ctrl-N support to the master branch it would save me some future work, but the library has designs and policies, so I'll follow your guide! Thanks for answering!
Author
Owner

@convto commented on GitHub (Mar 5, 2023):

I'll close this ticket now that it's resolved, Thanks!

<!-- gh-comment-id:1454970501 --> @convto commented on GitHub (Mar 5, 2023): I'll close this ticket now that it's resolved, Thanks!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#597
No description provided.