X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Finput%2Fkeys.cpp;h=38d94807b03fcc0d982f641a433f8aa98e4ae513;hb=a50eef72fac4b253bd014a32ec43b90e990b5784;hp=d7de3b1b326ae007168a4ca324edda30d66356f3;hpb=7a4a508629d370c4a79791c7e62fd6f59e8564e9;p=libs%2Fgui.git diff --git a/source/input/keys.cpp b/source/input/keys.cpp index d7de3b1..38d9480 100644 --- a/source/input/keys.cpp +++ b/source/input/keys.cpp @@ -1,15 +1,11 @@ -/* $Id$ - -This file is part of libmspgbase -Copyright © 2007 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #include -#ifndef WIN32 +#include +#ifdef WIN32 +#include +#else +#include #include #endif -#include #include "keys.h" using namespace std; @@ -108,19 +104,19 @@ namespace Input { unsigned key_from_sys(unsigned code) { - static bool init_done=false; + static bool init_done = false; static map reverse_map; if(!init_done) { for(unsigned i=0; i::const_iterator i=reverse_map.find(code); + map::const_iterator i = reverse_map.find(code); if(i!=reverse_map.end()) return i->second; @@ -129,8 +125,8 @@ unsigned key_from_sys(unsigned code) unsigned key_to_sys(unsigned key) { - if(key>N_KEYS_) - throw InvalidParameterValue("Key out of range"); + if(key>=N_KEYS_) + throw invalid_argument("key_to_sys"); return keymap[key]; }