Added (OS specific) clipboard implementation.
- Based on github.com/atotto/clipboard.
This commit is contained in:
parent
fcf31b381b
commit
f550220120
21
ui/clipboard/clipboard.go
Normal file
21
ui/clipboard/clipboard.go
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
package clipboard
|
||||||
|
|
||||||
|
import (
|
||||||
|
clip "github.com/atotto/clipboard" // actual implementation
|
||||||
|
"opslag.de/schobers/zntg/ui"
|
||||||
|
)
|
||||||
|
|
||||||
|
type clipboard struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c clipboard) WriteText(t string) error {
|
||||||
|
return clip.WriteAll(t)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c clipboard) ReadText() (string, error) {
|
||||||
|
return clip.ReadAll()
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
ui.DefaultClipboard = &clipboard{}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user