fix shortcut string function

This commit is contained in:
Tuxinal 2024-07-16 00:35:00 +03:30
parent 3925739afe
commit 657b51b0da

View file

@ -4,11 +4,11 @@
* Copyright (c) 2023 Vendicated and Vencord contributors * Copyright (c) 2023 Vendicated and Vencord contributors
*/ */
import { findByPropsLazy } from "@vencord/types/webpack"; import { findByCodeLazy } from "@vencord/types/webpack";
import { keybindCallbacks } from "renderer"; import { keybindCallbacks } from "renderer";
import { addPatch } from "./shared"; import { addPatch } from "./shared";
const { toString } = findByPropsLazy("keyToCode"); const toShortcutString = findByCodeLazy('return"gamepad".');
addPatch({ addPatch({
patches: [ patches: [
@ -52,7 +52,7 @@ addPatch({
registerKeybind: function (id, shortcut, callback, options) { registerKeybind: function (id, shortcut, callback, options) {
keybindCallbacks[id] = callback; keybindCallbacks[id] = callback;
VesktopNative.keybind.register(id, toString(shortcut), options); VesktopNative.keybind.register(id, toShortcutString(shortcut), options);
}, },
unregisterKeybind: function (id) { unregisterKeybind: function (id) {
delete keybindCallbacks[id]; delete keybindCallbacks[id];