mirror of
https://github.com/GayPizzaSpecifications/voxelotl-engine.git
synced 2025-08-03 05:10:57 +00:00
allow camera movement with the keyboard
This commit is contained in:
@ -69,6 +69,7 @@ public class Application {
|
||||
}
|
||||
|
||||
private func beginHandleEvents() {
|
||||
Keyboard.instance.newFrame()
|
||||
GameController.instance.newFrame()
|
||||
}
|
||||
|
||||
@ -82,10 +83,14 @@ public class Application {
|
||||
case SDLK_ESCAPE:
|
||||
return .exitSuccess
|
||||
default:
|
||||
break
|
||||
Keyboard.instance.keyDownEvent(scan: event.key.scancode, repeat: event.key.repeat != 0)
|
||||
}
|
||||
return .running
|
||||
|
||||
case SDL_EVENT_KEY_UP:
|
||||
Keyboard.instance.keyUpEvent(scan: event.key.scancode)
|
||||
return .running
|
||||
|
||||
case SDL_EVENT_GAMEPAD_ADDED:
|
||||
if SDL_IsGamepad(event.gdevice.which) != SDL_FALSE {
|
||||
GameController.instance.connectedEvent(id: event.gdevice.which)
|
||||
|
Reference in New Issue
Block a user