2025-07-19 19:41:27 +08:00

91 lines
2.3 KiB
JavaScript

var __renderjsModules={};
__renderjsModules["5c9edcc4"] = (() => {
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// <stdin>
var stdin_exports = {};
__export(stdin_exports, {
default: () => stdin_default
});
var code;
var oldCode;
var KeyName = {
19: "KeyUp",
38: "KeyUp",
//Keyboard
20: "KeyDown",
40: "KeyDown",
//Keyboard
21: "KeyLeft",
37: "KeyLeft",
//Keyboard
22: "KeyRight",
39: "KeyRight",
//Keyboard
23: "KeyEnter",
13: "KeyEnter",
//Keyboard
4: "KeyBack",
18: "KeyBack",
//Keyboard Alt键
27: "KeyBack",
//Keyboard ESC
24: "KeyBack",
//Keyboard ESC
66: "KeyEnter",
111: "KeyBack",
110: "KeyDel",
8: "KeyDel"
};
var stdin_default = {
mounted() {
window.document.onkeydown = function(evt) {
evt = evt || window.event;
var KeyCode = evt.which || evt.keyCode;
oldCode = KeyCode;
code = KeyName[KeyCode];
if (code != "KeyBack") {
evt.preventDefault();
}
if (code != void 0) {
document.getElementById("onClick").click();
} else {
document.getElementById("onClick2").click();
}
};
},
methods: {
onClick(event, ownerInstance) {
ownerInstance.callMethod("keyCodeClick", {
"code": code,
"oldCode": oldCode
});
},
onClick2(event, ownerInstance) {
ownerInstance.callMethod("keyCodeClick2", {
"code": code,
"oldCode": oldCode
});
}
}
};
return __toCommonJS(stdin_exports);
})();