Created
January 17, 2023 12:15
-
-
Save bjoerntx/3839fb4ff97f4abe4fd23322e45d3d7f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TXTextControl.addEventListener("inputPositionChanged", function (position) { | |
// if input position is is not coherent, reset character array | |
if (position.textPosition < trackedInputPosition - 1 || position.textPosition > trackedInputPosition + 1) { | |
charCodes = []; | |
} | |
// set current input position | |
trackedInputPosition = position.textPosition; | |
}) | |
document.getElementById("txTemplateDesignerContainer").addEventListener("keydown", (event) => { | |
// reset character array for all keys including ENTER, TAB and others except SPACE | |
if (event.keyCode < 0x30 && event.keyCode != 32) { | |
charCodes = []; | |
} | |
}, true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment