MISC: Add key binding feature (#1830)

This commit is contained in:
catloversg
2025-02-28 13:59:12 +07:00
committed by GitHub
parent 3ba89eb388
commit 8ed83f3d37
44 changed files with 1201 additions and 305 deletions
+40
View File
@@ -0,0 +1,40 @@
import { KeyBindingTypes } from "../../utils/KeyBindingUtils";
function getKeyBindingsSchemaProperties() {
const result: Record<string, unknown> = {};
for (const keyBindingType of KeyBindingTypes) {
result[keyBindingType] = {
type: "array",
minItems: 2,
items: {
type: "object",
nullable: true,
properties: {
control: {
type: "boolean",
},
alt: {
type: "boolean",
},
shift: {
type: "boolean",
},
meta: {
type: "boolean",
},
key: {
type: "string",
},
},
required: ["control", "alt", "shift", "meta", "key"],
},
};
}
return result;
}
export const KeyBindingsSchema = {
$schema: "http://json-schema.org/draft-07/schema#",
type: "object",
properties: getKeyBindingsSchemaProperties(),
};