integrate part of keyutil, and implement tab and block movement with keyboard (#70)

This commit is contained in:
Mike Sawka
2024-06-21 12:32:38 -07:00
committed by GitHub
parent 9cc5d9d3ae
commit 0ea8e5ac88
15 changed files with 483 additions and 25 deletions
+6
View File
@@ -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();
+1
View File
@@ -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),