コード例 #1
0
func (self *Keyboard) registerNewEvents(key KeyCode, event events.Event) {
	eventsFromKey, eventFound := self.keyToEvent[key]
	if eventFound {
		for _, eventFromKey := range eventsFromKey {
			event.EventType = eventFromKey
			self.eventReceived(event)
		}
	}
}
コード例 #2
0
ファイル: mouse.go プロジェクト: jasonroelofs/slartibartfast
func (self *Mouse) registerNewEvents(button MouseButtonCode, event events.Event) {
	eventsFromButton, eventFound := self.buttonToEvent[button]
	if eventFound {
		for _, eventFromButton := range eventsFromButton {
			event.EventType = eventFromButton
			self.eventReceived(event)
		}
	}
}