mirror of
https://github.com/rubickCenter/rubick
synced 2025-06-07 19:14:11 +08:00
优化-快捷键支持三键
This commit is contained in:
parent
b6b1c2eb08
commit
1dfb39c2e7
@ -255,7 +255,7 @@ const setConfig = debounce(() => {
|
||||
|
||||
watch(state, setConfig);
|
||||
|
||||
const changeShortCut = (e, key) => {
|
||||
const changeShortCutOld = (e, key) => {
|
||||
if (e.altKey && e.keyCode !== 18) {
|
||||
const compose = `Option+${keycodes[e.keyCode].toUpperCase()}`;
|
||||
state.shortCut[key] = compose;
|
||||
@ -274,6 +274,30 @@ const changeShortCut = (e, key) => {
|
||||
}
|
||||
};
|
||||
|
||||
const changeShortCut = (e, key) => {
|
||||
let compose = '';
|
||||
if (e.ctrlKey && e.keyCode !== 17) {
|
||||
compose += '+Ctrl';
|
||||
}
|
||||
if (e.shiftKey && e.keyCode !== 16) {
|
||||
compose += '+Shift';
|
||||
}
|
||||
if (e.altKey && e.keyCode !== 18) {
|
||||
compose += '+Option';
|
||||
}
|
||||
if (e.metaKey && e.keyCode !== 93) {
|
||||
compose += '+Command';
|
||||
}
|
||||
compose += '+'+keycodes[e.keyCode].toUpperCase();
|
||||
compose = compose.substring(1)
|
||||
console.log(compose);
|
||||
if(e.keyCode !== 16 && e.keyCode !== 17 && e.keyCode !== 18 && e.keyCode !== 93){
|
||||
state.shortCut[key] = compose;
|
||||
}else{
|
||||
// 不做处理
|
||||
}
|
||||
};
|
||||
|
||||
const changeGlobalKey = (e, index) => {
|
||||
let compose;
|
||||
if (e.altKey && e.keyCode !== 18) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user