标签:config ati script vscode window linu sys gis lin
使用vscode调试
1.在 VSCode 中打开一个 Electron 项目。 $ git clone git@github.com:electron/electron-quick-start.git $ code electron-quick-start Copy 2.添加一个 .vscode/launch.json 文件并使用以下配置: { "version": "0.2.0", "configurations": [ { "name": "Debug Main Process", "type": "node", "request": "launch", "cwd": "${workspaceRoot}", "runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron", "windows": { "runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd" }, "args" : ["."] } ] }
注册全局快捷键
const {app, globalShortcut} = require(‘electron‘) app.on(‘ready‘, () => { // 注册一个 ‘CommandOrControl+X‘ 的全局快捷键 const ret = globalShortcut.register(‘CommandOrControl+X‘, () => { console.log(‘CommandOrControl+X is pressed‘) }) if (!ret) { console.log(‘registration failed‘) } // 检查快捷键是否注册成功 console.log(globalShortcut.isRegistered(‘CommandOrControl+X‘)) }) app.on(‘will-quit‘, () => { // 注销快捷键 globalShortcut.unregister(‘CommandOrControl+X‘) // 清空所有快捷键 globalShortcut.unregisterAll() })
相关方法
globalShortcut.register(accelerator, callback)
有用的应用 https://electronjs.org/apps/mockman 模拟服务器
https://electronjs.org/apps/advanced-rest-client 模拟请求
https://electronjs.org/apps/reversee
https://electronjs.org/apps/ling
https://electronjs.org/apps/hyper
https://electronjs.org/apps/system-designer
https://electronjs.org/apps/altair xxxxx
标签:config ati script vscode window linu sys gis lin
原文地址:https://www.cnblogs.com/honghong87/p/10156424.html