Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visually display customizable search keyboard shortcut to user #2391

Closed
vhscom opened this issue Mar 27, 2024 · 2 comments · Fixed by #2469
Closed

Visually display customizable search keyboard shortcut to user #2391

vhscom opened this issue Mar 27, 2024 · 2 comments · Fixed by #2469

Comments

@vhscom
Copy link

vhscom commented Mar 27, 2024

Feature request

Problem or desire

#2278 added keyboard shortcuts for search and, I believe, collapsing the sidebar. In order to make it easier for users to discover keyboard shortcuts associated with search I'd like the ability to display a kbd key combo so users can quickly find it like:

Screenshot 2024-03-27 at 11 25 41 AM

Proposal

Add and style a presentational keyboard shortcut key for sighted users. If there's more than one keyboard shortcut for search, allow the user to pick one keyboard option to display to the user.

Implementation

Something like:

<kbd class="keyboard-shortcut"><span class="keyboard-shortcut-keys"></span>K</kbd>
@jhildenbiddle
Copy link
Member

Hi @vhscom.

A keyboard shortcut icon was added in #2278 (issue) / #2279 (PR). It currently shows a forward slash. You can review this on our develop branch preview. This feature will not be available publicly until Docsify v5 is released.

<kbd title="Press / to search">/</kbd>

FYI, both Command+K and Control+K work as well as search shortcuts. I opted to display / because it is a single keystroke and universal across operating systems. Conditionally displaying ⌘ K for macOS or ⌃ K for other operating systems require OS detection which I was hoping to avoid. That said, I'm not opposed to making the switch since Command/Control+K is more common.

@jhildenbiddle jhildenbiddle linked a pull request Jul 19, 2024 that will close this issue
6 tasks
@jhildenbiddle
Copy link
Member

This issue has been addressed by PR #2469. The changes will be available when Docsify v5 is released.

CleanShot 2024-07-19 at 11 42 05@2x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants