adam-gui/vendor/fyne.io/fyne/v2/internal/driver/mobile/keyboard.go

29 lines
639 B
Go
Raw Permalink Normal View History

2024-04-29 19:13:50 +02:00
package mobile
import (
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/driver/mobile"
"fyne.io/fyne/v2/internal/driver/mobile/app"
)
func showVirtualKeyboard(keyboard mobile.KeyboardType) {
if driver, ok := fyne.CurrentApp().Driver().(*mobileDriver); ok {
if driver.app == nil { // not yet running
fyne.LogError("Cannot show keyboard before app is running", nil)
return
}
driver.app.ShowVirtualKeyboard(app.KeyboardType(keyboard))
}
}
func hideVirtualKeyboard() {
if driver, ok := fyne.CurrentApp().Driver().(*mobileDriver); ok {
if driver.app == nil { // not yet running
return
}
driver.app.HideVirtualKeyboard()
}
}