1
0
Fork 1
mirror of https://github.com/Vendicated/Vencord.git synced 2025-01-25 08:46:25 +00:00

Added main modifier key changing

This commit is contained in:
nin0dev 2024-02-17 05:55:43 -05:00
parent 9a634ab999
commit 3f3f9677ca

View file

@ -337,9 +337,20 @@ export default definePlugin({
enabledByDefault: true,
onKey(e: KeyboardEvent) {
const hasCtrl = e.ctrlKey || (e.metaKey && navigator.platform.includes("Mac"));
let hasModifierKey;
switch (settings.store.mainModifierKey) {
case "ctrl":
hasModifierKey = e.ctrlKey || (e.metaKey && navigator.platform.includes("Mac"));
break;
case "shift":
hasModifierKey = e.shiftKey;
break;
case "alt":
hasModifierKey = e.altKey;
break;
}
if (hasCtrl) switch (e.key) {
if (hasModifierKey) switch (e.key) {
case "t":
case "T":
e.preventDefault();