From 1ed2e8eb1f1909a35f6fc8d5d6065bcac37c27ea Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Tue, 5 Feb 2008 22:23:15 +0000 Subject: keyboard handling, cvar fixes --- src/client/console.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/client/console.cc') diff --git a/src/client/console.cc b/src/client/console.cc index bf193e5..d10be50 100644 --- a/src/client/console.cc +++ b/src/client/console.cc @@ -6,6 +6,7 @@ #include "client/console.h" #include "client/video.h" +#include "client/keys.h" #include "core/core.h" #include "render/render.h" @@ -159,9 +160,9 @@ void toggle() console_visible = !console_visible; } -void handle_keypressed(SDL_keysym* keysym) +void keypressed(const SDL_keysym &keysym) { - switch( keysym->sym ) { + switch( keysym.sym ) { case SDLK_RETURN: if (input.size()) { core::cmd << input << std::endl; @@ -177,8 +178,8 @@ void handle_keypressed(SDL_keysym* keysym) break; } - if (keysym->sym >= 32 && keysym->sym <= 175) { - input += (char) keysym->sym; + if ((keysym.sym >= 32 ) && (keysym.sym <175)) { + input += keysym_to_char(keysym); } } -- cgit v1.2.3