Merge pull request #2416 from thelounge/xpaw/out-of-focus-touch

Allow out-of-focus typing on touch devices
This commit is contained in:
Jérémie Astori 2018-05-07 02:23:35 -04:00 committed by GitHub
commit 0cd6366b5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 21 deletions

View File

@ -247,8 +247,7 @@ const ignoredKeys = {
224: true, // Meta 224: true, // Meta
}; };
if (!("ontouchstart" in window || navigator.maxTouchPoints > 0)) { $(document.body).on("keydown", (e) => {
$(document.body).on("keydown", (e) => {
// Ignore if target isn't body (e.g. focused into input) // Ignore if target isn't body (e.g. focused into input)
// Ignore any key that uses alt modifier // Ignore any key that uses alt modifier
// Ignore keys defined above // Ignore keys defined above
@ -269,5 +268,4 @@ if (!("ontouchstart" in window || navigator.maxTouchPoints > 0)) {
} }
input.trigger("focus"); input.trigger("focus");
}); });
}