1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-09-02 18:37:55 +00:00

Fix out-of-bounds when pasting too-long text

Used a `<=` instead of a `<`! How did I mess this up!?

Fixes #2209
This commit is contained in:
Jonathan Coates
2025-06-02 08:58:43 +01:00
parent 876fd8ddb8
commit b5c0c6e104
3 changed files with 39 additions and 2 deletions

View File

@@ -26,7 +26,8 @@ public class KeyConverter {
var name = GLFW.glfwGetKeyName(key, scanCode);
if (name == null || name.length() != 1) return key;
// If we've got a single character key name, try to translate it to a
// If we've got a single character as the key name, treat that as the ASCII value of the key,
// and map that back to a key code.
var character = name.charAt(0);
// 0-9 and A-Z map directly to their GLFW key (they're the same ASCII code).