...
 
Commits (2)
    https://gitcode.net/codechina_dev/quicker/-/commit/2b3caaf19fd926f9c3b81e37236f532039daf4e0 release0.0.4 2022-01-14T14:31:52+08:00 layyback 18511759309@163.com https://gitcode.net/codechina_dev/quicker/-/commit/0fbe6a3c60deefe8659b89e183105eba93063c9f fix:修复快捷键bug 2022-01-14T15:02:17+08:00 layyback 18511759309@163.com
{ {
"name": "Quicker", "name": "Quicker",
"version": "0.0.3", "version": "0.0.4",
"author": "libai", "author": "libai",
"description": "An electron-vue project", "description": "An electron-vue project",
"license": null, "license": null,
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
"build": { "build": {
"asar": true, "asar": true,
"productName": "Quicker", "productName": "Quicker",
"appId": "com.muwoo.rubick", "appId": "com.layyback.quicker",
"compression": "maximum", "compression": "maximum",
"directories": { "directories": {
"output": "build" "output": "build"
......
...@@ -20,7 +20,7 @@ module.exports = () => { ...@@ -20,7 +20,7 @@ module.exports = () => {
resizable: true, resizable: true,
width: 920, width: 920,
frame: false, frame: false,
backgroundColor: "#fff", // backgroundColor: "#fff",
title: "拉比克", title: "拉比克",
show: true, show: true,
skipTaskbar: true, skipTaskbar: true,
......
...@@ -12,7 +12,7 @@ const defaultConfigForAnyPlatform = { ...@@ -12,7 +12,7 @@ const defaultConfigForAnyPlatform = {
shortCut: { shortCut: {
showAndHidden: "Option+R", showAndHidden: "Option+R",
separate: "Ctrl+D", separate: "Ctrl+D",
quit: "Shift+Escape" quit: "Shift+Escape",
}, },
common: { common: {
start: true, start: true,
......
...@@ -62,6 +62,7 @@ class Listener { ...@@ -62,6 +62,7 @@ class Listener {
registerShortCut(mainWindow) { registerShortCut(mainWindow) {
const config = global.opConfig.get(); const config = global.opConfig.get();
globalShortcut.unregisterAll(); globalShortcut.unregisterAll();
this.registerQuitPluginShortCut(mainWindow)
// 注册偏好快捷键 // 注册偏好快捷键
globalShortcut.register(config.perf.shortCut.showAndHidden, () => { globalShortcut.register(config.perf.shortCut.showAndHidden, () => {
const { x, y } = screen.getCursorScreenPoint(); const { x, y } = screen.getCursorScreenPoint();
...@@ -124,7 +125,8 @@ class Listener { ...@@ -124,7 +125,8 @@ class Listener {
this.setAutoLogin(); this.setAutoLogin();
this.colorPicker(); this.colorPicker();
this.initPlugin(); this.initPlugin(mainWindow);
this.registerQuitPluginShortCut(mainWindow)
this.lockScreen(); this.lockScreen();
this.separate(); this.separate();
this.initCapture(); this.initCapture();
...@@ -219,7 +221,7 @@ class Listener { ...@@ -219,7 +221,7 @@ class Listener {
if (win === null || win === undefined) { if (win === null || win === undefined) {
login.createWindow(mainWindow); login.createWindow(mainWindow);
} else { } else {
win.show() win.show();
} }
}); });
} }
...@@ -305,12 +307,18 @@ class Listener { ...@@ -305,12 +307,18 @@ class Listener {
}); });
} }
initPlugin() { initPlugin(mainWindow) {
ipcMain.on("optionPlugin", (e, args) => { ipcMain.on("optionPlugin", (e, args) => {
this.optionPlugin = args; this.optionPlugin = args;
}); });
} }
registerQuitPluginShortCut(mainWindow) {
globalShortcut.register("Esc", () => {
mainWindow.webContents.send("quitPlugin");
});
}
lockScreen() { lockScreen() {
// 锁屏 // 锁屏
ipcMain.on("lock-screen", () => { ipcMain.on("lock-screen", () => {
......
...@@ -29,6 +29,7 @@ class initApp { ...@@ -29,6 +29,7 @@ class initApp {
this.onReady(); this.onReady();
this.onRunning(); this.onRunning();
this.onQuit(); this.onQuit();
// main.registerQuitPluginShortCut()
} }
} }
......
...@@ -186,10 +186,18 @@ export default { ...@@ -186,10 +186,18 @@ export default {
pluginInfo: pluginInfo pluginInfo: pluginInfo
}); });
}; };
// document.addEventListener("keydown", e => {
// console.log(e);
// if (e.keyCode === 27) {
// this.closeTag();
// this.changeMode("view");
// }
// });
}, },
mounted() { mounted() {
ipcRenderer.on("init-rubick", this.closeTag); ipcRenderer.on("init-rubick", this.closeTag);
ipcRenderer.on("new-window", this.newWindow); ipcRenderer.on("new-window", this.newWindow);
ipcRenderer.on("quitPlugin", this.quitPlugin);
// 超级面板打开插件 // 超级面板打开插件
ipcRenderer.on("superPanel-openPlugin", (e, args) => { ipcRenderer.on("superPanel-openPlugin", (e, args) => {
this.closeTag(); this.closeTag();
...@@ -367,11 +375,14 @@ export default { ...@@ -367,11 +375,14 @@ export default {
return `<div>${result[0]}</div>`; return `<div>${result[0]}</div>`;
} }
}, },
quitPlugin() {
this.closeTag();
this.changeMode("view");
},
checkNeedInit(e) { checkNeedInit(e) {
// 如果搜索栏无内容,且按了删除键,则清空 tag // 如果搜索栏无内容,且按了删除键,则清空 tag
if (this.searchValue === "" && e.keyCode === 8) { if (this.searchValue === "" && e.keyCode === 8) {
this.closeTag(); this.quitPlugin();
this.changeMode("view");
} }
}, },
changePath({ key }) { changePath({ key }) {
......
...@@ -39,7 +39,8 @@ export default { ...@@ -39,7 +39,8 @@ export default {
}; };
}, },
mounted() { mounted() {
this.setSubPlaceHolder("按 ⌫ 键退出插件"); this.setSubPlaceHolder("按 Esc 键退出插件");
// this.setSubPlaceHolder("按 ⌫ 键退出插件");
this.webview = document.querySelector("webview"); this.webview = document.querySelector("webview");
// if (!this.webview) return; // if (!this.webview) return;
this.webview.addEventListener("dom-ready", () => { this.webview.addEventListener("dom-ready", () => {
......
...@@ -49,7 +49,8 @@ export default { ...@@ -49,7 +49,8 @@ export default {
} }
}, },
mounted() { mounted() {
this.setSubPlaceHolder("按 ⌫ 键退出"); this.setSubPlaceHolder("按 Esc 键退出");
// this.setSubPlaceHolder("按 ⌫ 键退出");
}, },
computed: { computed: {
...mapState("main", [ ...mapState("main", [
......
...@@ -37,12 +37,17 @@ ...@@ -37,12 +37,17 @@
<div <div
class="value" class="value"
tabIndex="-1" tabIndex="-1"
@click="shortCutChange = true"
@keyup="e => changeShortCut(e, 'showAndHidden')" @keyup="e => changeShortCut(e, 'showAndHidden')"
> >
{{ config.perf.shortCut.showAndHidden }} {{
shortCutChange
? "输入快捷组合键"
: config.perf.shortCut.showAndHidden
}}
</div> </div>
</div> </div>
<div class="settings-item-li"> <!-- <div class="settings-item-li">
<div class="label">插件分离快捷键</div> <div class="label">插件分离快捷键</div>
<div <div
class="value" class="value"
...@@ -51,8 +56,8 @@ ...@@ -51,8 +56,8 @@
> >
{{ config.perf.shortCut.separate }} {{ config.perf.shortCut.separate }}
</div> </div>
</div> </div> -->
<div class="settings-item-li"> <!-- <div class="settings-item-li">
<div class="label">返回主界面</div> <div class="label">返回主界面</div>
<div <div
class="value" class="value"
...@@ -61,7 +66,7 @@ ...@@ -61,7 +66,7 @@
> >
{{ config.perf.shortCut.quit }} {{ config.perf.shortCut.quit }}
</div> </div>
</div> </div> -->
</div> </div>
<div class="setting-item"> <div class="setting-item">
<div class="title">通用</div> <div class="title">通用</div>
...@@ -187,6 +192,7 @@ export default { ...@@ -187,6 +192,7 @@ export default {
currentSelect: [3], currentSelect: [3],
config: { ...opConfig.get() }, config: { ...opConfig.get() },
signLoading: false, signLoading: false,
shortCutChange: false,
examples: [ examples: [
{ {
title: "快捷键 「 Alt + W」 关键字 「 微信」", title: "快捷键 「 Alt + W」 关键字 「 微信」",
...@@ -239,27 +245,30 @@ export default { ...@@ -239,27 +245,30 @@ export default {
ipcRenderer.send("logout"); ipcRenderer.send("logout");
}, },
changeShortCut(e, key) { changeShortCut(e, key) {
let change = false; // let change = false;
if (e.altKey && e.keyCode !== 18) { if (e.altKey && e.keyCode !== 18) {
const compose = `Option+${keycodes[e.keyCode].toUpperCase()}`; const compose = `Option+${keycodes[e.keyCode].toUpperCase()}`;
this.config.perf.shortCut[key] = compose; this.config.perf.shortCut[key] = compose;
change = true; // change = true;
} }
if (e.ctrlKey && e.keyCode !== 17) { if (e.ctrlKey && e.keyCode !== 17) {
const compose = `Ctrl+${keycodes[e.keyCode].toUpperCase()}`; const compose = `Ctrl+${keycodes[e.keyCode].toUpperCase()}`;
this.config.perf.shortCut[key] = compose; this.config.perf.shortCut[key] = compose;
change = true; // change = true;
} }
if (e.shiftKey && e.keyCode !== 16) { if (e.shiftKey && e.keyCode !== 16) {
const compose = `Shift+${keycodes[e.keyCode].toUpperCase()}`; const compose = `Shift+${keycodes[e.keyCode].toUpperCase()}`;
this.config.perf.shortCut[key] = compose; this.config.perf.shortCut[key] = compose;
change = true; // change = true;
} }
if (e.metaKey && e.keyCode !== 93) { if (e.metaKey && e.keyCode !== 93) {
const compose = `Command+${keycodes[e.keyCode].toUpperCase()}`; const compose = `Command+${keycodes[e.keyCode].toUpperCase()}`;
this.config.perf.shortCut[key] = compose; this.config.perf.shortCut[key] = compose;
change = true; // change = true;
} }
this.saveConfig();
this.config = { ...opConfig.get() };
this.shortCutChange = false;
}, },
addConfig() { addConfig() {
this.config.global.push({ this.config.global.push({
......
...@@ -290,7 +290,7 @@ const actions = { ...@@ -290,7 +290,7 @@ const actions = {
/** /**
* @param {Object} payload payload.filePath为配置文件的绝对路径。payload.value为搜索栏文字值。 * @param {Object} payload payload.filePath为配置文件的绝对路径。payload.value为搜索栏文字值。
*/ */
async onSearch({ commit }, payload) { async onSearch({ commit, getters }, payload) {
if (state.selected && state.selected.key !== "plugin-container") { if (state.selected && state.selected.key !== "plugin-container") {
commit("commonUpdate", { searchValue: "" }); commit("commonUpdate", { searchValue: "" });
return; return;
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
text-decoration: none; text-decoration: none;
cursor: pointer; cursor: pointer;
position: relative; position: relative;
border-bottom: 1px dashed; border-bottom: 1px dashed #fc5531;
padding-bottom: 2px; padding-bottom: 2px;
box-sizing: border-box; box-sizing: border-box;
color: inherit; color: inherit;
......