|
From: Tapio V. <aa...@us...> - 2010-01-18 21:41:06
|
Module: performous
Branch: master
Commit: f344b0b2b7aecc21f0ef6798a5cb70e3b5b30e8d
Author: Tapio Vierros <tap...@gm...>
Date: Mon Jan 18 23:40:22 2010 +0200
Add keyboard testing to --jstest.
---
game/main.cc | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/game/main.cc b/game/main.cc
index 6a0d491..4843252 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -212,6 +212,8 @@ void jstestLoop() {
while(SDL_PollEvent(&e) == 1) {
if (e.type == SDL_QUIT || (e.type == SDL_KEYDOWN && e.key.keysym.sym == SDLK_ESCAPE)) {
return;
+ } else if (e.type == SDL_KEYDOWN) {
+ std::cout << "Keyboard key: " << int(e.key.keysym.sym) << ", mod: " << int(e.key.keysym.mod) << std::endl;
} else if (e.type == SDL_JOYBUTTONDOWN) {
std::cout << "JoyID: " << int(e.jbutton.which) << ", button: " << int(e.jbutton.button) << ", state: " << int(e.jbutton.state) << std::endl;
} else if (e.type == SDL_JOYAXISMOTION) {
|