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:
parent
9a634ab999
commit
3f3f9677ca
1 changed files with 13 additions and 2 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue