Sander Schobers
1aad3bf11a
Fixed bug where copy/cut/paste/select all weren't executed. Fixed bug where start/end of selection wasn't properly set when typing. Removed SetClipboard.
22 lines
333 B
Go
22 lines
333 B
Go
package ui
|
|
|
|
type Clipboard interface {
|
|
WriteText(t string) error
|
|
ReadText() (string, error)
|
|
}
|
|
|
|
var DefaultClipboard Clipboard = &clipboard{}
|
|
|
|
type clipboard struct {
|
|
value string
|
|
}
|
|
|
|
func (c *clipboard) WriteText(t string) error {
|
|
c.value = t
|
|
return nil
|
|
}
|
|
|
|
func (c *clipboard) ReadText() (string, error) {
|
|
return c.value, nil
|
|
}
|