Fix elementary mouse issue

Fixes #34

This commit requires a modification to tcell before it will work.
This commit is contained in:
Zachary Yedidia
2016-04-22 19:12:32 -04:00
parent 15dbf37154
commit 3d76898afe

View File

@@ -526,9 +526,9 @@ func (v *View) HandleEvent(event tcell.Event) {
case tcell.Button1:
// Left click
origX, origY := v.cursor.x, v.cursor.y
v.MoveToMouseClick(x, y)
if v.mouseReleased && !e.HasMotion() {
v.MoveToMouseClick(x, y)
if (time.Since(v.lastClickTime)/time.Millisecond < doubleClickThreshold) &&
(origX == v.cursor.x && origY == v.cursor.y) {
if v.doubleClick {
@@ -558,7 +558,8 @@ func (v *View) HandleEvent(event tcell.Event) {
v.cursor.curSelection[1] = loc
}
v.mouseReleased = false
} else {
} else if !v.mouseReleased {
v.MoveToMouseClick(x, y)
if v.tripleClick {
v.cursor.AddLineToSelection()
} else if v.doubleClick {