aboutsummaryrefslogtreecommitdiff
path: root/go/ui/textInput_generic.go
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2025-04-29 14:44:48 -0500
committerFlorian Fischer <florian.fischer@muhq.space>2025-08-20 15:57:16 +0200
commitbe2aad1142bde494229d9d27d4123923aa578c1a (patch)
treea564d1f6655c29426e1175b6d377769037e041ad /go/ui/textInput_generic.go
parent24d6e81d6f878f0ef4910ac125101dab963a913a (diff)
downloadmuhqs-game-be2aad1142bde494229d9d27d4123923aa578c1a.tar.gz
muhqs-game-be2aad1142bde494229d9d27d4123923aa578c1a.zip
overhaul ui
* implement events instead of interfaces Interfaces and the wrappers head the problem that they could not support multiple events at once or only a single one without loosing the others. * add text input support for WASM on mobile A hidden html input is required to open the keyboard and receive the input. * improve the number choice * fix using the default number * add submit button only if a onclick method was provided
Diffstat (limited to 'go/ui/textInput_generic.go')
-rw-r--r--go/ui/textInput_generic.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/go/ui/textInput_generic.go b/go/ui/textInput_generic.go
new file mode 100644
index 00000000..7102eb82
--- /dev/null
+++ b/go/ui/textInput_generic.go
@@ -0,0 +1,16 @@
+//go:build !wasm
+// +build !wasm
+
+package ui
+
+func (ti *TextInput) Focus(focus bool) {
+ ti.focused = focus
+}
+
+func (*TextInput) IsUpdatable() bool { return true }
+func (ti *TextInput) Update() error {
+ if ti.focused {
+ }
+
+ return nil
+}