andlabs / ui

Platform-native GUI library for Go.
Other
8.33k stars 652 forks source link

entry: handle onKeyEvent #375

Closed ghost closed 4 years ago

ghost commented 4 years ago

no x86 linux binary update. no build environment fetching binaries from https://github.com/andlabs/libui/pull/488

to check: controlgallery.go

    e :=ui.NewEntry()
    e.OnKeyEvent(func(_ *ui.Entry, ke *ui.AreaKeyEvent) (handled bool) {
        fmt.Println("-- [key event] ---------- %d", ke.Key)

        if (ke.Key == '\n') {
            fmt.Println("-- [enter] -----------")
            return true
        }
        return false
    })