event.go 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package fyne
  2. // HardwareKey contains information associated with physical key events
  3. // Most applications should use KeyName for cross-platform compatibility.
  4. type HardwareKey struct {
  5. // ScanCode represents a hardware ID for (normally desktop) keyboard events.
  6. ScanCode int
  7. }
  8. // KeyEvent describes a keyboard input event.
  9. type KeyEvent struct {
  10. // Name describes the keyboard event that is consistent across platforms.
  11. Name KeyName
  12. // Physical is a platform specific field that reports the hardware information of physical keyboard events.
  13. Physical HardwareKey
  14. }
  15. // PointEvent describes a pointer input event. The position is relative to the
  16. // top-left of the CanvasObject this is triggered on.
  17. type PointEvent struct {
  18. AbsolutePosition Position // The absolute position of the event
  19. Position Position // The relative position of the event
  20. }
  21. // ScrollEvent defines the parameters of a pointer or other scroll event.
  22. // The DeltaX and DeltaY represent how large the scroll was in two dimensions.
  23. type ScrollEvent struct {
  24. PointEvent
  25. Scrolled Delta
  26. }
  27. // DragEvent defines the parameters of a pointer or other drag event.
  28. // The DraggedX and DraggedY fields show how far the item was dragged since the last event.
  29. type DragEvent struct {
  30. PointEvent
  31. Dragged Delta
  32. }