Fix strange logic in Hierarchy event managing
This commit is contained in:
parent
8d3a708bca
commit
687b40b35a
@ -26,8 +26,8 @@ func (this *Hierarchy) HandleKeyDown (key input.Key, numberPad bool) {
|
||||
} else {
|
||||
this.focusNext()
|
||||
}
|
||||
} else if this.focused != nil {
|
||||
this.keyboardTarget().handleKeyDown(key, numberPad)
|
||||
} else if target := this.keyboardTarget(); target != nil {
|
||||
target.handleKeyDown(key, numberPad)
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,8 +35,8 @@ func (this *Hierarchy) HandleKeyDown (key input.Key, numberPad bool) {
|
||||
// which triggers this comes with modifier key information, HandleModifiers must
|
||||
// be called *before* HandleKeyUp.
|
||||
func (this *Hierarchy) HandleKeyUp (key input.Key, numberPad bool) {
|
||||
if this.focused == nil {
|
||||
this.keyboardTarget().handleKeyUp(key, numberPad)
|
||||
if target := this.keyboardTarget(); target != nil {
|
||||
target.handleKeyDown(key, numberPad)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user