mirror of
https://github.com/mum4k/termdash.git
synced 2026-04-27 03:15:55 +03:00
[GH-ISSUE #243] What are the keyboard shortcuts for changing widget focus? #135
Labels
No labels
bug
cleanup
enhancement
enhancement
enhancement
good first issue
help wanted
help wanted
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/termdash#135
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 @HouzuoGuo on GitHub (Aug 4, 2020).
Original GitHub issue: https://github.com/mum4k/termdash/issues/243
Originally assigned to: @mum4k on GitHub.
Good day. This wiki article says:
"Focus can be changed using mouse or keyboard shortcuts." https://github.com/mum4k/termdash/blob/master/doc/hld.md
I'm working with a terminal without mouse support. What are the shortcuts for changing focus? Thanks.
@HouzuoGuo commented on GitHub (Aug 4, 2020):
BTW - I'm running the "textinputdemo.go", and trying to acquire focus in that text box to type something.
@mum4k commented on GitHub (Aug 5, 2020):
Hi @HouzuoGuo, thanks for reaching out. The quoted document is actually the design document for termdash, and I am afraid not all part of it were implemented yet. Currently the only way to change the focus is to use a mouse click, this is handled in this library:
https://github.com/mum4k/termdash/blob/master/container/focus.go
We could easily expose a new method on the Container object:
github.com/mum4k/termdash@a8457a77ce/container/container.go (L38-L41)I.e. a method that moves focus to this container. Then we can assign a specific shortcut to each container to move focus to it. Alternatively if we wanted to change focus using something like arrow keys, we could implement traversal on the tree of containers as requested by pressing an arrow.
@HouzuoGuo commented on GitHub (Aug 5, 2020):
Many thanks!
@fpabl0 commented on GitHub (Nov 16, 2020):
Hi @mum4k any updates on this feature? I want to change focus with Tab key.
BTW, great library! Thanks!
@mum4k commented on GitHub (Nov 17, 2020):
Hi @fpabl0, I think the current status is that we are looking for an owner who would be willing to pick this up and design and implement this feature. Sorry that I wasn't clear about that in my last update. Are you or @HouzuoGuo interested, or would you prefer if try to find the time?
Once we have the owner, we can discuss on how exactly would this feature work. Another idea that comes to mind is that we could allow the users of termdash to set two keyboard shortcuts. One to move focus forward and one backward. Internally termdash would act on receiving those shortcuts and cycle the focus just between the visible containers (containers that contain widgets (or containers that are the leaf nodes in the binary tree of containers on the terminal).
If one of you is interested in picking this up, I will be happy to help you out by providing code pointers and discussing the approach, etc. Please let me know.
@HouzuoGuo commented on GitHub (Nov 19, 2020):
thanks for your work on this library.. though my calendar looks a bit busy throughout December :|
@mum4k commented on GitHub (Nov 20, 2020):
Thank you for your response @HouzuoGuo and that is not a problem.
@mum4k commented on GitHub (Nov 22, 2020):
I have some time in the coming few days, so I can give this a try.
If either of you is interested in testing the feature and giving feedback on it before we release it, please let me know. I can update this issue once I have a working prototype.
@HouzuoGuo commented on GitHub (Nov 23, 2020):
Thanks, you've done a great job with this library so far!
There is a rather old linux utility called "dialog" (https://linux.die.net/man/1/dialog), it is sometimes used by OS installers (e.g. debian forked it) and offers a pretty rich set of UI elements similar to those offered by this library.
/usr/share/doc/dialog/examples/has some ready-to-run demos to try out the keyboard interaction.If it makes sense, would you please consider making the keyboard navigation experience of this library similar to those offered by an existing utility, such as dialog?
@mum4k commented on GitHub (Nov 24, 2020):
Thank you @HouzuoGuo for mentioning
dialog. I didn't know about it and it does provide a lot of good inspiration.The way how keyboard navigation works pretty much aligns with what I had in mind. I will give it a try and update here once we have something ready.
@HouzuoGuo commented on GitHub (Nov 24, 2020):
lovely, thanks very much!
@mum4k commented on GitHub (Dec 30, 2020):
This functionality was included in the latest release v0.14.0. The release includes a demo that shows the newly added keyboard navigation:
Feel free to let me know if there are any missing features or issues.
@HouzuoGuo commented on GitHub (Dec 30, 2020):
wonderful & happy new year!
@mum4k commented on GitHub (Dec 31, 2020):
A happy new year to you too. Feel free to reopen this issue in case of any problems with the keyboard navigation feature.