Skip to content

Commit

Permalink
Allow setting mouse event positions
Browse files Browse the repository at this point in the history
  • Loading branch information
zyedidia authored and JoeKar committed Oct 15, 2024
1 parent 9bdff1f commit 5b50625
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ func (ev *EventMouse) Position() (int, int) {
return ev.x, ev.y
}

func (ev *EventMouse) SetPosition(x, y int) {
ev.x, ev.y = x, y
}

// NewEventMouse is used to create a new mouse event. Applications
// shouldn't need to use this; its mostly for screen implementors.
func NewEventMouse(x, y int, btn ButtonMask, mod ModMask) *EventMouse {
Expand Down

0 comments on commit 5b50625

Please sign in to comment.