Replies: 3 comments 8 replies
-
This is really tricky in imgui. I will try to figure it out later. |
Beta Was this translation helpful? Give feedback.
1 reply
-
@rbeer Can you tell me more about your case and I might be able to provide more help here. :P |
Beta Was this translation helpful? Give feedback.
7 replies
-
@rbeer what about this? package main
import (
"fmt"
"github.com/AllenDang/giu"
)
var out string
func loop() {
giu.SingleWindow().Layout(
giu.InputText(&out),
giu.Event().OnKeyPressed(giu.KeyEnter, func() {
fmt.Println("enter pressed")
}),
)
}
func main() {
wnd := giu.NewMasterWindow("wnd", 640, 480, 0)
wnd.Run(loop)
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to call a function when the {Enter} key is pressed in a simple - not multiline - InputText.
I've been trying all sorts of combinations:
.Callback() - I see keys pressed and the EventChar(), but {Enter} blurs the InputText and never fires the event that would have EventChar() == 257
.Custom() with IsKeyPressed(257) - I get the event, but everywhere; even when InputText doesn't have focus.
.Custom() with IsKeyPressed(257) and IsItemActive() - does nothing, at all
I don't understand how the Events work, really. What for example is
Item
inIsItemActive
?Beta Was this translation helpful? Give feedback.
All reactions