mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-17 22:29:52 +08:00
dynamic keymap layout style fix (#2594)
This commit is contained in:
parent
be8fcdbe3e
commit
01fedf40ee
2 changed files with 4 additions and 4 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue