mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 21:35:54 +03:00
[GH-ISSUE #22] Watch for additional keys for making cell, row or column selection #16
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#16
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @andrewuhl on GitHub (Jan 13, 2018).
Original GitHub issue: https://github.com/rivo/tview/issues/22
Currently, table watches for ENTER key press to enter the table for selection of cell/row/column. It would be useful to have an additional key (or keys) watched so that, e.g., one key could be captured to make a full row selection, while different (possibly user-defined) key(s) could be captured to make a full column selection: E.g.
@rivo commented on GitHub (Jan 14, 2018):
Sorry for the late response. I had to think about this a bit. And this was related to an internal todo I've had in mind for a while. Many primitives offer a default key handling, e.g. the
TextViewallows you to navigate the view's content in a Vim-like fashion. This may not be what you want so you should be able to change that handling or install a custom key event handler for additional functionality (like you suggested).The
Boxprimitive now has a functionSetInputCapture()which allows you to intercept any key events sent to a primitive. BecauseBoxis the superclass of all other primitives, this is available to all of them.Btw, The same function also exists for
Application, allowing you to intercept all key events. (This was previouslySetKeyCapture()which has been removed in favour of this new function.)Anyway, using those new functions, you should be able to achieve what you described.