Zuoqiu-Yingyi / siyuan-theme-dark-plus

思源笔记的一款多功能双模式主题 | A multifunctional dual-mode theme of SiYuan Note.
GNU Affero General Public License v3.0
139 stars 14 forks source link

建议:鼠标中键抬起优化 #102

Closed winter60 closed 2 years ago

winter60 commented 2 years ago

现在中键抬起会触发“新窗口”打开,这本身没什么问题,可这与鼠标中键拖动实现快速上下滚动有点冲突,只要一抬起就可能会误触到“新窗口”功能。

不知道实现是否困难,如果太复杂就算了~可关闭该issue

Zuoqiu-Yingyi commented 2 years ago

可以更改默认的快捷键 https://github.com/Zuoqiu-Yingyi/siyuan-theme-dark-plus/blob/1e4f2dc6d08e28c751c127f4f4d116d8ee678def/script/module/config.js#L2641-L2648

方法: 打开或新建 data/widgets/custom.js 文件, 在文件中添加如下配置选项并更改具体的按键组合, 或者禁用该快捷键(下个版本的功能)

export const config = {
    theme: {
        hotkeys: {
            window: {
                open: {
                    link: {
                        outfocus: {
                            // 新窗口打开链接(鼠标中键)
                            enable: true,
                            CtrlCmd: false,
                            WinCtrl: false,
                            Shift: false,
                            Alt: false,
                            button: 1, // 鼠标中键
                        },
                    },
                },
            },
        },
    },
};
winter60 commented 2 years ago

可配置性太强了,牛逼~ 我刚刚用另一种方法解决了,在中键滚动后抬起钱按下ctrl键再抬起就解决了。谢谢萌佬指导~