func Update() {
	pressedKeys := make([]glfw.Key, 0, 10)
	pressedKeysThisFrame := make([]glfw.Key, 0, 10)

	// glfw.KeySpace is the lowest key.
	for i := glfw.KeySpace; i < keyRange; i++ {
		if down[i] {
			pressedKeys = append(pressedKeys, i)
		}
		if downThisFrame[i] {
			pressedKeysThisFrame = append(pressedKeysThisFrame, i)
			downThisFrame[i] = false
		}
	}
	if len(pressedKeys) > 0 {
		messagebus.SendSync(&messagebus.Message{Type: "key", Data1: pressedKeys, Data2: pressedKeysThisFrame})
	}
}
// Update calls all of the currently pressed keys.
Update calls all of the currently pressed keys.
// Update calls all of the currently pressed keys .
func Update() {
	pressedKeys := make([]glfw.Key, 0, 10)
	pressedKeysThisFrame := make([]glfw.Key, 0, 10)
	for i := glfw.KeySpace; i < keyRange; i++ {
		if down[i] {
			pressedKeys = append(pressedKeys, i)
		}
		if downThisFrame[i] {
			pressedKeysThisFrame = append(pressedKeysThisFrame, i)
			downThisFrame[i] = false
		}
	}
	if len(pressedKeys) > 0 {
		messagebus.SendSync(&messagebus.Message{Type: "key", Data1: pressedKeys, Data2: pressedKeysThisFrame})
	}
}
func Update ( ) { pressedKeys := make ( [ ] glfw . Key , 0 , 10 ) pressedKeysThisFrame := make ( [ ] glfw . Key , 0 , 10 ) for i := glfw . KeySpace ; i < keyRange ; i ++ { if down [ i ] { pressedKeys = append ( pressedKeys , i ) } if downThisFrame [ i ] { pressedKeysThisFrame = append ( pressedKeysThisFrame , i ) downThisFrame [ i ] = false } } if len ( pressedKeys ) > 0 { messagebus . SendSync ( & messagebus . Message { Type : " " , Data1 : pressedKeys , Data2 : pressedKeysThisFrame } ) } }
Update calls all of the currently pressed keys.
Update calls all of the currently pressed keys .
// glfw.KeySpace is the lowest key.