mouse click vs drag works
This commit is contained in:
parent
0aa82f5ba5
commit
44264df09d
|
@ -22,6 +22,10 @@ func mouseUp(g *gocui.Gui, v *gocui.View) error {
|
|||
}
|
||||
*/
|
||||
|
||||
if time.Since(me.mouse.down) < me.mouse.clicktime {
|
||||
log.Info("was a mouse click, not a drag")
|
||||
}
|
||||
|
||||
me.mouse.mouseUp = true
|
||||
me.globalMouseDown = false
|
||||
me.currentDrag = nil
|
||||
|
@ -35,8 +39,8 @@ func mouseUp(g *gocui.Gui, v *gocui.View) error {
|
|||
// widget was underneath so you can active
|
||||
// the right response for the toolkit user's app
|
||||
func mouseDown(g *gocui.Gui, v *gocui.View) error {
|
||||
me.globalMouseDown = true
|
||||
if me.mouse.mouseUp {
|
||||
me.globalMouseDown = true
|
||||
me.mouse.mouseUp = false
|
||||
me.mouse.down = time.Now()
|
||||
w, h := g.MousePosition()
|
||||
|
|
|
@ -13,6 +13,7 @@ package main
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/awesome-gocui/gocui"
|
||||
log "go.wit.com/log"
|
||||
|
@ -32,12 +33,10 @@ func mouseMove(g *gocui.Gui) {
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
if time.Since(me.mouse.down) < me.mouse.clicktime {
|
||||
log.Info("not yet")
|
||||
return
|
||||
}
|
||||
*/
|
||||
if time.Since(me.mouse.down) < me.mouse.clicktime {
|
||||
// log.Info("not yet")
|
||||
return
|
||||
}
|
||||
|
||||
w, h := g.MousePosition()
|
||||
// toggle off all highlight vies except for whatever is under the mouse
|
||||
|
|
Loading…
Reference in New Issue