Decided to drop the whole handled thing with Area events and just continue the event chain if needed. Same for MousEvent; will have to document that. This is just the test program for now.

This commit is contained in:
Pietro Gagliardi 2014-06-01 23:34:26 -04:00
parent 7e5a810e51
commit 370649ec51
2 changed files with 5 additions and 5 deletions

View File

@ -44,7 +44,7 @@ func markkey(dest *image.RGBA, keypt image.Point, m Modifiers) {
draw.Draw(dest, xr, xi, image.ZP, draw.Over) draw.Draw(dest, xr, xi, image.ZP, draw.Over)
} }
func (a *keyboardArea) Key(e KeyEvent) (handled bool, repaint bool) { func (a *keyboardArea) Key(e KeyEvent) (repaint bool) {
a.lock.Lock() a.lock.Lock()
defer a.lock.Unlock() defer a.lock.Unlock()
@ -68,9 +68,9 @@ func (a *keyboardArea) Key(e KeyEvent) (handled bool, repaint bool) {
markkey(a.kbd, modpoints[Super], m &^ Super) markkey(a.kbd, modpoints[Super], m &^ Super)
} }
default: default:
return false, false return false
} }
return true, true return true
} }
var doKeyboard = flag.Bool("kb", false, "run keyboard test (overrides -areabounds)") var doKeyboard = flag.Bool("kb", false, "run keyboard test (overrides -areabounds)")

View File

@ -164,9 +164,9 @@ func (a *areaHandler) Mouse(e MouseEvent) bool {
fmt.Printf("%#v\n", e) fmt.Printf("%#v\n", e)
return false return false
} }
func (a *areaHandler) Key(e KeyEvent) (bool, bool) { func (a *areaHandler) Key(e KeyEvent) bool {
fmt.Printf("%#v %q\n", e, e.Key) fmt.Printf("%#v %q\n", e, e.Key)
return false, false return false
} }
var doArea = flag.Bool("area", false, "run area test instead (overrides -kb and -areabounds)") var doArea = flag.Bool("area", false, "run area test instead (overrides -kb and -areabounds)")