diff options
author | Juuz <6596629+Juuxel@users.noreply.github.com> | 2021-05-27 21:59:11 +0300 |
---|---|---|
committer | Juuz <6596629+Juuxel@users.noreply.github.com> | 2021-05-27 21:59:11 +0300 |
commit | 4b2388466aae42ab37f37b60b0ee33894b32bef8 (patch) | |
tree | 06429c7d55a8826ecc484993f116b1b061fe0dde /src/main/java/io | |
parent | bce5799d0db55260ab3f1c872e6f2ba64c6c6c67 (diff) | |
download | LibGui-4b2388466aae42ab37f37b60b0ee33894b32bef8.tar.gz LibGui-4b2388466aae42ab37f37b60b0ee33894b32bef8.tar.bz2 LibGui-4b2388466aae42ab37f37b60b0ee33894b32bef8.zip |
Fix #111
Diffstat (limited to 'src/main/java/io')
-rw-r--r-- | src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java index ba47296..5f6059f 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WTextField.java @@ -559,6 +559,7 @@ public class WTextField extends WWidget { String after = this.text.substring(cursor, this.text.length()); this.text = before+ch+after; cursor++; + if (onChanged != null) onChanged.accept(text); } } @@ -606,6 +607,8 @@ public class WTextField extends WWidget { if (cursor>text.length()) cursor = text.length(); } } + + if (onChanged != null) onChanged.accept(text); return; } else if (Screen.isSelectAll(ch)) { select = 0; @@ -639,6 +642,8 @@ public class WTextField extends WWidget { text = before+after; cursor--; } + + if (onChanged != null) onChanged.accept(text); } } else if (ch==GLFW.GLFW_KEY_LEFT) { if (select!=-1) { |