Пример #1
0
func (self *View) processKeyDown(w driver.Window, e event.KeyDown) {
	if self.content != nil {
		keyDown(w, self.content, event.Key(e))

		switch e.Code {
		case '\t':
			direction := forward

			if e.Mods.Has(key.Shift) {
				direction = backward
			}

			if owner, first := findFocus(self.content, nil, direction); owner == nil && first != nil {
				first.HandleFocusChange(w, event.Focus{true})
			}
		}
	}
}
Пример #2
0
func (self *View) processKeyUp(w driver.Window, e event.KeyUp) {
	if self.content != nil {
		keyUp(w, self.content, event.Key(e))
	}
}