Clicking on messages will copy them to the clipboard

Fixes #172
This commit is contained in:
Zachary Yedidia 2016-06-17 11:24:54 -04:00
parent d2277a376a
commit 8be0f9c529

View file

@ -7,6 +7,7 @@ import (
"os"
"runtime"
"github.com/atotto/clipboard"
"github.com/go-errors/errors"
"github.com/layeh/gopher-luar"
"github.com/mattn/go-isatty"
@ -275,6 +276,16 @@ func main() {
case event = <-events:
}
switch e := event.(type) {
case *tcell.EventMouse:
_, h := screen.Size()
_, y := e.Position()
if y == h-1 {
clipboard.WriteAll(messenger.message)
}
continue
}
if TabbarHandleMouseEvent(event) {
continue
}