Is your feature request related to a problem? Please describe.
I would like to SetOnTypedKey() for Entry to do specific action when some entry is Focused.
Is it possible to construct a solution with the existing API?
I don't know
Describe the solution you'd like
I can do SetOnTypedKey() for canvas:
c.window.Canvas().SetOnTypedKey(c.typedKey)
Possible variant for entries:
entry.SetOnTypedKey(c.typedKey)
newMultiLineEntry.SetOnTypedKey(c.typedKey)
newPasswordEntry.SetOnTypedKey(c.typedKey)
example of Key Events handler:
func (c *someType) typedKey(ev *fyne.KeyEvent) {
if ev.Name == fyne.KeyReturn {
entry.SetText("")
}
}
We are trying to avoid exposing too many details or customisations in the standard widgets. Would extending the entry widget and adding the key handling which falls back to the default be a possibility perhaps?
I think yes, thank you for considering my issue.
Thanks. I would provide demo code, but we are improving this area for the next release...
Feel free to stop by our Slack chat room or await our release in 3 weeks.
There is some really helpful code in #537 which provides this functionality in our upcoming 1.2 release (ready for testing on develop branch).
Most helpful comment
There is some really helpful code in #537 which provides this functionality in our upcoming 1.2 release (ready for testing on develop branch).