Found input error

Android does insertCompositionText instead of insertText
This commit is contained in:
FlamedDogo99 2024-06-08 22:36:10 -06:00
parent be0bcc2b30
commit bddf687e17

View File

@ -6,7 +6,7 @@
// @downloadURL https://raw.githubusercontent.com/FlamedDogo99/EaglerMobile/main/eaglermobile.user.js // @downloadURL https://raw.githubusercontent.com/FlamedDogo99/EaglerMobile/main/eaglermobile.user.js
// @license Apache License 2.0 - http://www.apache.org/licenses/ // @license Apache License 2.0 - http://www.apache.org/licenses/
// @match https://eaglercraft.com/mc/* // @match https://eaglercraft.com/mc/*
// @version 3.0.4-chat-fix // @version 3.0.5-chat-fix
// @updateURL https://raw.githubusercontent.com/FlamedDogo99/EaglerMobile/main/eaglermobile.user.js // @updateURL https://raw.githubusercontent.com/FlamedDogo99/EaglerMobile/main/eaglermobile.user.js
// @run-at document-start // @run-at document-start
// ==/UserScript== // ==/UserScript==
@ -54,7 +54,7 @@ Object.defineProperty(EventTarget.prototype, "addEventListener", {
} else { } else {
// _addEventListener.call(this, type, fn, ...rest); // _addEventListener.call(this, type, fn, ...rest);
_addEventListener.call(this, type, function(...args) { _addEventListener.call(this, type, function(...args) {
console.log(`%c CALLED ${type}`, 'background: #222; color: #bada55', args); // console.log(`%c CALLED ${type}`, 'background: #222; color: #bada55', args);
return fn.apply(this, args); return fn.apply(this, args);
}, ...rest); }, ...rest);
} }
@ -379,7 +379,7 @@ function insertCanvasElements() {
window.lastKey = inputData window.lastKey = inputData
hiddenInput.value = " "; // We need a character to detect deleting hiddenInput.value = " "; // We need a character to detect deleting
if(window.keyboardFix) { if(window.keyboardFix) {
if(e.inputType == 'insertText') { if(e.inputType == 'insertText' || e.inputType == 'insertCompositionText') {
let isShift = (inputData.toLowerCase() != inputData); let isShift = (inputData.toLowerCase() != inputData);
if(isShift) { if(isShift) {
keyEvent("shift", "keydown") keyEvent("shift", "keydown")