mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-09-21 07:46:15 +08:00
Merge pull request #909 from SeerLite/istrusted
Fix isTrusted check on keyboard events
This commit is contained in:
commit
43bc3d5bc6
|
@ -4819,8 +4819,8 @@ $(document).on("click", "#commandLineMobileButton", () => {
|
|||
let dontInsertSpace = false;
|
||||
|
||||
$(document).keyup((event) => {
|
||||
if (!event.isTrusted) return;
|
||||
|
||||
if (!event.originalEvent.isTrusted) return;
|
||||
|
||||
if (resultVisible) return;
|
||||
let now = performance.now();
|
||||
let diff = Math.abs(keypressStats.duration.current - now);
|
||||
|
@ -4832,8 +4832,8 @@ $(document).keyup((event) => {
|
|||
});
|
||||
|
||||
$(document).keydown(function (event) {
|
||||
if (!event.isTrusted) return;
|
||||
|
||||
if (!event.originalEvent.isTrusted) return;
|
||||
|
||||
if (!resultVisible) {
|
||||
let now = performance.now();
|
||||
let diff = Math.abs(keypressStats.spacing.current - now);
|
||||
|
|
Loading…
Reference in a new issue