summaryrefslogtreecommitdiff
path: root/structs.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-08 08:07:03 -0600
committerJeff Carr <[email protected]>2025-02-08 08:07:03 -0600
commit0aa82f5ba56f9e393e681971115881cc185f20c8 (patch)
tree74c5e8276da5e4fe29ea682c44a1f0f6aefca3df /structs.go
parent83b4d7142a32230e5f037758ebe0f8f279fed7f5 (diff)
trying to delay on mouse drag
Diffstat (limited to 'structs.go')
-rw-r--r--structs.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/structs.go b/structs.go
index 3e10910..c7368de 100644
--- a/structs.go
+++ b/structs.go
@@ -13,6 +13,7 @@ import (
"reflect"
"strconv"
"sync"
+ "time"
"github.com/awesome-gocui/gocui"
@@ -73,6 +74,19 @@ type config struct {
downH int // where the mouse was pressed down
currentDrag *guiWidget // what widget is currently being moved around
dark bool // use a 'dark' color palette
+ mouse mouse // mouse settings
+}
+
+// stuff controlling how the mouse works
+type mouse struct {
+ down time.Time // when the mouse was pressed down
+ up time.Time // when the mouse was released. used to detect click vs drag
+ clicktime time.Duration // how long is too long for a mouse click vs drag
+ mouseUp bool // is the mouse up?
+ downW int // where the mouse was pressed down
+ downH int // where the mouse was pressed down
+ currentDrag *guiWidget // what widget is currently being moved around
+ globalMouseDown bool // yep, mouse is pressed
}
// settings for the stdout window