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

组件是否可以对搜索支持快捷键 #1054

Open
imvkmark opened this issue Mar 23, 2022 · 2 comments
Open

组件是否可以对搜索支持快捷键 #1054

imvkmark opened this issue Mar 23, 2022 · 2 comments
Labels
feature:extension Feature request that affects widgets, comment, share, search, and plugins.

Comments

@imvkmark
Copy link

确保你在提交功能建议之前仔细阅读了Hexo文档Icarus用户指南,和GitHub issues来了解你的建议是否已经被他人提出过。

你的功能建议与某个使用问题相关么?请详述。

搜索的时候能能够支持快捷键, 比如 cmd+/ 作为很多文档的搜索快捷键

描述你想要的解决方案

是否可以支持常用的快捷键, 或者部分快捷组合

描述你考虑过的替代办法

暂无

额外上下文

附上与功能请求有关的其他上下文信息或者截图。

image

@ppoffice ppoffice added the feature:extension Feature request that affects widgets, comment, share, search, and plugins. label Mar 23, 2022
@imvkmark
Copy link
Author

imvkmark commented Aug 6, 2022

我来催更了..

@2-3-5-7
Copy link

2-3-5-7 commented May 18, 2023

@imvkmark
正好需要,node_modules\hexo-theme-icarus\source\js\main.js 加入下面的

document.onkeydown = function(e) {
        // https://javascript.info/keyboard-events
        if (e.ctrlKey && e.code == "KeyK") {
            document.querySelector("a.navbar-item.search").click();
            e.preventDefault();
        }
};

目前快捷键是 Ctrl + K,可以参考注释中的链接来改 e.code 那个判断

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature:extension Feature request that affects widgets, comment, share, search, and plugins.
Projects
None yet
Development

No branches or pull requests

3 participants