mirror of
https://github.com/rivo/tview.git
synced 2026-04-27 05:45:49 +03:00
[GH-ISSUE #93] customised command mode input field #72
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#72
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 @stephencheng on GitHub (Mar 30, 2018).
Original GitHub issue: https://github.com/rivo/tview/issues/93
I have special need to implement a command mode input field.
Basically, I use this type of field to hook up with defined key for quick value change. For example:
I hacked the code for the test, it worked perfect, shown as below:
`
`
I thought I should follow the guid of the primitive sample to make it my own inputfield, so I did a copy of the inputfield go file in order to just add my own logic to handle the key binding part. I could replace all different inner function with exported public method, like Getxx in order to remove compilation errors, but there is one left, which is the border(bool)
if i.border { x++ y++ rightLimit -= 2 }so my questions:
Thank you
@rivo commented on GitHub (Apr 1, 2018):
I think what you'll want is
SetInputCapture(). There is an example in the Wiki. It's on theApplicationlevel but it works the same for primitives.Let me know if this works for you.
@stephencheng commented on GitHub (Apr 3, 2018):
Thanks. primitive level SetInputCapture is exactly what I needed.
It's great to have all these loving feature already there