We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3f188ae commit dd8eedeCopy full SHA for dd8eede
example/ui.go
@@ -150,17 +150,19 @@ func (g *Game) logWindow(ctx *debugui.Context) {
150
}
151
})
152
ctx.GridCell(func() {
153
- var submitted bool
+ var submit bool
154
ctx.SetGridLayout([]int{-1, 70}, nil)
155
if ctx.TextField(&g.logSubmitBuf) {
156
- if ebiten.IsKeyPressed(ebiten.KeyEnter) {
157
- submitted = true
+ if g.logSubmitBuf != "" && ebiten.IsKeyPressed(ebiten.KeyEnter) {
+ submit = true
158
159
160
if ctx.Button("Submit") {
161
+ if g.logSubmitBuf != "" {
162
163
+ }
164
- if submitted {
165
+ if submit {
166
g.writeLog(g.logSubmitBuf)
167
g.logSubmitBuf = ""
168
ctx.SetTextFieldValue(&g.logSubmitBuf)
0 commit comments