]> git.tdb.fi Git - libs/gui.git/blobdiff - source/input/keys.cpp
Header updates
[libs/gui.git] / source / input / keys.cpp
index 15f729abe16652ea0f5304e540e9d39333791f76..082e02299b9c829f4458024147d8fe3d16b0f099 100644 (file)
@@ -1,10 +1,3 @@
-/* $Id$
-
-This file is part of libmspgbase
-Copyright © 2008, 2010 Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #include <map>
 #ifdef WIN32
 #include <windows.h>
@@ -120,19 +113,19 @@ namespace Input {
 
 unsigned key_from_sys(unsigned code)
 {
-       static bool init_done=false;
+       static bool init_done = false;
        static map<unsigned, unsigned> reverse_map;
 
        if(!init_done)
        {
                for(unsigned i=0; i<N_KEYS_; ++i)
                        if(keymap[i])
-                               reverse_map[keymap[i]]=i;
+                               reverse_map[keymap[i]] = i;
 
-               init_done=true;
+               init_done = true;
        }
 
-       map<unsigned, unsigned>::const_iterator i=reverse_map.find(code);
+       map<unsigned, unsigned>::const_iterator i = reverse_map.find(code);
        if(i!=reverse_map.end())
                return i->second;
 
@@ -148,10 +141,10 @@ unsigned key_to_sys(unsigned key)
 
 unsigned mod_from_sys(unsigned mod)
 {
-       unsigned result;
+       unsigned result = 0;
        for(unsigned i=0; i<N_MODS_; ++i)
                if(mod&modmap[i])
-                       result|=1<<i;
+                       result |= 1<<i;
        return result;
 }