fyne-io / fyne

Cross platform GUI toolkit in Go inspired by Material Design
https://fyne.io/
Other
25.29k stars 1.4k forks source link

Mobile simulator is missing keyboard support #591

Open Jacalz opened 4 years ago

Jacalz commented 4 years ago

Describe the bug When building an app and trying to test it on the computer as if it was running on a phone, we compile with go build -tags mobile. But doing so makes it impossible to type anything into the entry fields, however the buttons work.

To Reproduce

  1. Build the following example code using go build -tags mobile:
    
    package main

import ( "fmt" "fyne.io/fyne" "fyne.io/fyne/app" "fyne.io/fyne/layout" "fyne.io/fyne/widget" )

func main() { app := app.New()

window := app.NewWindow("Example")

user := widget.NewEntry()
user.SetPlaceHolder("Username")

password := widget.NewPasswordEntry()
password.SetPlaceHolder("Password")

login := widget.NewButton("Login", func() {
    fmt.Println("You may now act as if you were logged in :)")
})

window.SetContent(fyne.NewContainerWithLayout(layout.NewGridLayout(1), user, password, login))

window.ShowAndRun()

}


2. try to type in the entry widgets.

**Device (please complete the following information):**
- OS: Solus (A Linux Distrubution)
- Version: Solus 4.0 using Linux Kernel 5.3.18
- Go version: 1.13.5
- Fyne version: 1.2.0 and 1.2.1 have been tested.
andydotxyz commented 4 years ago

Yes, currently we do not support hardware keyboards in mobile apps. Either package the app and install it in an emulator or on device - or use it in desktop mode to test the keyboard functions.

andydotxyz commented 4 years ago

Can you please test this with the fyne_demo app? We have some fixes internally that may be helping, if that works we could work to share the enhancement...

Jacalz commented 4 years ago

Sorry for the late response. I have now given this some testing on the release/v1.2.3 and develop branches without any success. The issue is still 100% reproducible for me on Linux.

andydotxyz commented 4 years ago

Can you please try the fyne_demo application in mobile mode on your computer and see if it works? I think I have a hunch...

Jacalz commented 4 years ago

@andydotxyz It was exactly what I was doing the whole time. Please look at the comment above ;)

andydotxyz commented 4 years ago

Apologies, I thought you meant testing your app on those versions. Can you confirm what window manager and display technology you are using on Solus?

Jacalz commented 4 years ago

Sure. I was using the Budgie Desktop which basically uses X11 and the mutter window manager from Gnome Desktop.

andydotxyz commented 4 years ago

All of a sudden I can replicate this again. Strange :)

metal3d commented 3 years ago

Bug is present with develop branch here, on Fedora 33 / Gnome 3 - no keyboard

metal3d commented 3 years ago

There is this error:

2021/03/21 18:29:45 Fyne error:  Cannot show keyboard before app is running
2021/03/21 18:29:45   At: /home/metal3d/.local/share/go/pkg/mod/fyne.io/fyne/v2@v2.0.2-0.20210319215240-17b9c647d7c9/internal/driver/gomobile/keyboard.go:12
Jacalz commented 3 years ago

There is this error:

2021/03/21 18:29:45 Fyne error:  Cannot show keyboard before app is running
2021/03/21 18:29:45   At: /home/metal3d/.local/share/go/pkg/mod/fyne.io/fyne/v2@v2.0.2-0.20210319215240-17b9c647d7c9/internal/driver/gomobile/keyboard.go:12

Hmm, I don’t honk that’s related. As I understand it, this is mostly a missing feature of the mobile driver.

andydotxyz commented 3 years ago

Yes, the mobile simulation elements of the driver (i.e. the desktop code for the mobile driver) is incomplete. Should work just fine in the Android emulator or on a device.

metal3d commented 3 years ago

Yes, of course, there is no problem in the emulator (when it is usable 😀) or on the device. I only said that this is "still" not working on a computer with mobile tag 🙂 But, IMHO, the "mobile tag" is only a "preview", so I don't use it a lot.

savely-krasovsky commented 1 year ago

Does it relates to Steam Deck with SteamOS? It's virtual keyboard cannot type some special characters for some reason only in Fyne app.

Jacalz commented 1 year ago

Does it relates to Steam Deck with SteamOS? It's virtual keyboard cannot type some special characters for some reason only in Fyne app.

If you are not building with -tags mobile, then no, it should not be related in any way. It is likely another bug.

savely-krasovsky commented 1 year ago

@Jacalz I will try to write simple app to reproduce the issue.

andydotxyz commented 1 year ago

That is helpful, thanks - but please open a new issue with what you find. This ticket is regarding hardware keyboards and won't have the same fix as the issue you are describing.