Skip to content

Commit

Permalink
fix: implement String() method for MouseButton type
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed Sep 16, 2024
1 parent 62e46fe commit a26ecc5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ const (
MouseExtra2
)

// String returns a string representation of the mouse button.
func (b MouseButton) String() string {
return mouseButtons[b]
}

var mouseButtons = map[MouseButton]string{
MouseNone: "none",
MouseLeft: "left",
Expand Down

0 comments on commit a26ecc5

Please sign in to comment.