dynamic keymap layout style fix (#2594)

This commit is contained in:
Ferotiq 2022-02-26 20:02:16 -06:00 committed by GitHub
parent be8fcdbe3e
commit 01fedf40ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -1,10 +1,10 @@
import Config from "../config";
import * as Misc from "../misc";
import { capsLock } from "./caps-warning";
import { capsState } from "./caps-warning";
export async function getCharFromEvent(event) {
function emulatedLayoutShouldShiftKey(event, newKeyPreview) {
if (capsLock) return Misc.isASCIILetter(newKeyPreview) !== event.shiftKey;
if (capsState) return Misc.isASCIILetter(newKeyPreview) !== event.shiftKey;
return event.shiftKey;
}

View file

@ -1,6 +1,6 @@
import Config from "../config";
import * as Misc from "../misc";
import { capsLock } from "./caps-warning";
import { capsState } from "./caps-warning";
export let leftState = false;
export let rightState = false;
@ -19,7 +19,7 @@ function dynamicKeymapLegendStyle(uppercase) {
const keys = keymapKeys.map((el) => el.childNodes[1]);
if (capsLock) uppercase = !uppercase;
if (capsState) uppercase = !uppercase;
if (layoutKeys.filter((v) => v === undefined).length > 2) return;