mirror of
https://github.com/wavetermdev/backup.git
synced 2026-08-05 13:57:07 -07:00
integrate part of keyutil, and implement tab and block movement with keyboard (#70)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
// Copyright 2024, Command Line Inc.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import * as keyutil from "@/util/keyutil";
|
||||
import * as electron from "electron";
|
||||
import fs from "fs";
|
||||
import * as child_process from "node:child_process";
|
||||
@@ -37,6 +38,7 @@ let unameArch: string = process.arch;
|
||||
if (unameArch == "x64") {
|
||||
unameArch = "amd64";
|
||||
}
|
||||
keyutil.setKeyUtilPlatform(unamePlatform);
|
||||
|
||||
function getBaseHostPort(): string {
|
||||
if (isDev) {
|
||||
@@ -386,6 +388,10 @@ electron.ipcMain.on("isDevServer", (event) => {
|
||||
event.returnValue = isDevServer;
|
||||
});
|
||||
|
||||
electron.ipcMain.on("getPlatform", (event) => {
|
||||
event.returnValue = unamePlatform;
|
||||
});
|
||||
|
||||
electron.ipcMain.on("getCursorPoint", (event) => {
|
||||
const window = electron.BrowserWindow.fromWebContents(event.sender);
|
||||
const screenPoint = electron.screen.getCursorScreenPoint();
|
||||
|
||||
@@ -6,6 +6,7 @@ let { contextBridge, ipcRenderer } = require("electron");
|
||||
contextBridge.exposeInMainWorld("api", {
|
||||
isDev: () => ipcRenderer.sendSync("isDev"),
|
||||
isDevServer: () => ipcRenderer.sendSync("isDevServer"),
|
||||
getPlatform: () => ipcRenderer.sendSync("getPlatform"),
|
||||
getCursorPoint: () => ipcRenderer.sendSync("getCursorPoint"),
|
||||
openNewWindow: () => ipcRenderer.send("openNewWindow"),
|
||||
contextEditMenu: (position, opts) => ipcRenderer.send("context-editmenu", position, opts),
|
||||
|
||||
Reference in New Issue
Block a user