key_test.cpp

Go to the documentation of this file.
00001 /* $Id: key_test.cpp 23842 2008-02-16 08:47:16Z mordante $ */
00002 /*
00003    Copyright (C) 2003 - 2008 by David White <dave@whitevine.net>
00004    Part of the Battle for Wesnoth Project http://www.wesnoth.org/
00005 
00006    This program is free software; you can redistribute it and/or modify
00007    it under the terms of the GNU General Public License version 2
00008    or at your option any later version.
00009    This program is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY.
00011 
00012    See the COPYING file for more details.
00013 */
00014 
00015 //! @file tools/key_test.cpp
00016 //! Keyboard-test - Standalone-Utility
00017 
00018 #include "key.h"
00019 #include "video.hpp"
00020 
00021 int main( void )
00022 {
00023     SDL_Init(SDL_INIT_VIDEO);
00024     CVideo video( 640, 480, 16, 0 );
00025     CKey key;
00026     printf( "press enter (escape exits)...\n" );
00027     for(;;) {
00028         if( key[KEY_RETURN] != 0 )
00029             printf( "key(ENTER) pressed\n" );
00030         if( key[SDLK_ESCAPE] != 0 )
00031             return 1;
00032     }
00033 }

Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs