closes #42 - editField clipboard support

This commit is contained in:
Vladimir Markelov 2015-11-24 10:26:42 -08:00
parent 3dc059c8b8
commit 35566a4486

View File

@ -1,6 +1,7 @@
package clui
import (
clip "github.com/atotto/clipboard"
xs "github.com/huandu/xstrings"
term "github.com/nsf/termbox-go"
)
@ -288,6 +289,13 @@ func (e *EditField) ProcessEvent(event Event) bool {
case term.KeyArrowRight:
e.charRight()
return true
case term.KeyCtrlC:
clip.WriteAll(e.Title())
return true
case term.KeyCtrlV:
s, _ := clip.ReadAll()
e.SetTitle(s)
return true
default:
if event.Ch != 0 {
e.insertRune(event.Ch)