device.go 522 B

12345678910111213141516171819202122232425
  1. package glfw
  2. import (
  3. "runtime"
  4. "fyne.io/fyne/v2"
  5. )
  6. type glDevice struct {
  7. }
  8. // Declare conformity with Device
  9. var _ fyne.Device = (*glDevice)(nil)
  10. func (*glDevice) Orientation() fyne.DeviceOrientation {
  11. return fyne.OrientationHorizontalLeft // TODO should we consider the monitor orientation or topmost window?
  12. }
  13. func (*glDevice) HasKeyboard() bool {
  14. return true // TODO actually check - we could be in tablet mode
  15. }
  16. func (*glDevice) IsBrowser() bool {
  17. return runtime.GOARCH == "js" || runtime.GOOS == "js"
  18. }