mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 13:25:51 +03:00
[GH-ISSUE #181] SetInputCapture not working with forms #142
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#142
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 @dentych on GitHub (Nov 7, 2018).
Original GitHub issue: https://github.com/rivo/tview/issues/181
Hello.
I don't seem to be able to make SetInputCapture work with forms.
I added a SetInputCapture to the bottom part of the Form primitive demo code.
"TEST OUTPUT" is never printed on the screen. It works fine with for example Lists
@rivo commented on GitHub (Nov 10, 2018):
Yes, that's because
Formpasses on the keyboard focus to its contained form elements. So it never receives any keyboard events itself.You may be able to use
Application.SetInputCapture()but it will capture all keyboard events, even if the form is currently not being used. So it will require some logic to determine if the user is currently working on the form.Would that work for you?
@rivo commented on GitHub (Nov 19, 2018):
I'm closing this for now. We can reopen this issue if you'd like to continue the discussion.
@dentych commented on GitHub (Nov 19, 2018):
Oh, sorry. I actually thought I had replied to this issue.
But it is possible to work around this, I just figured that because the method is available on the Form type it should also work as expected. Either that or have the method removed, so people don't get their hopes up 😄
@rivo commented on GitHub (Nov 26, 2018):
I added some clarification to the function comments. I can't remove the function as it is inherited by
Box.