diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/kbtest.go | 10 | ||||
| -rw-r--r-- | test/main.go | 7 |
2 files changed, 10 insertions, 7 deletions
diff --git a/test/kbtest.go b/test/kbtest.go index 0a21954..d6fa7c1 100644 --- a/test/kbtest.go +++ b/test/kbtest.go @@ -34,7 +34,9 @@ func (a *keyboardArea) Paint(cliprect image.Rectangle) *image.NRGBA { return a.kbd.SubImage(cliprect).(*image.NRGBA) } -func (a *keyboardArea) Mouse(MouseEvent) {} +func (a *keyboardArea) Mouse(MouseEvent) (repaint bool) { + return false +} func markkey(dest *image.NRGBA, keypt image.Point, m Modifiers) { xr := keyrect(m).Add(keypt) @@ -42,7 +44,7 @@ func markkey(dest *image.NRGBA, keypt image.Point, m Modifiers) { draw.Draw(dest, xr, xi, image.ZP, draw.Over) } -func (a *keyboardArea) Key(e KeyEvent) bool { +func (a *keyboardArea) Key(e KeyEvent) (handled bool, repaint bool) { a.lock.Lock() defer a.lock.Unlock() @@ -68,9 +70,9 @@ func (a *keyboardArea) Key(e KeyEvent) bool { // markkey(a.kbd, modpoints[Super], m &^ Super) // } default: - return false + return false, false } - return true + return true, true } var doKeyboard = flag.Bool("kb", false, "run keyboard test") diff --git a/test/main.go b/test/main.go index 60108ab..1e2b465 100644 --- a/test/main.go +++ b/test/main.go @@ -131,12 +131,13 @@ func (a *areaHandler) Paint(rect image.Rectangle) *image.NRGBA { */ return a.img.SubImage(rect).(*image.NRGBA) } -func (a *areaHandler) Mouse(e MouseEvent) { +func (a *areaHandler) Mouse(e MouseEvent) bool { fmt.Printf("%#v\n", e) + return false } -func (a *areaHandler) Key(e KeyEvent) bool { +func (a *areaHandler) Key(e KeyEvent) (bool, bool) { fmt.Printf("%#v\n", e) - return false + return false, false } var doArea = flag.Bool("area", false, "run area test instead (overrides -kb)") |
