]> git.tdb.fi Git - libs/gui.git/commitdiff
Add KEY_NONE constant
authorMikko Rasa <tdb@tdb.fi>
Wed, 5 Jun 2013 06:59:22 +0000 (09:59 +0300)
committerMikko Rasa <tdb@tdb.fi>
Wed, 5 Jun 2013 06:59:22 +0000 (09:59 +0300)
source/input/keys.h
source/input/windows/keyboard.cpp
source/input/x11/keyboard.cpp

index c5822f89e14870170d09c3520be2e3720457e41e..7d4822cae3647ffa51047fe5ebc6c41ddb08b012 100644 (file)
@@ -6,6 +6,8 @@ namespace Input {
 
 enum
 {
+       KEY_NONE = 0x00,
+
        // Codes 0x01-0x7E reserved for ASCII
        KEY_BACKSPACE = 0x08,
        KEY_TAB = 0x09,
index 24b019ebcb5e4c3c8989654433df5f7a95cef6e5..cbba914dd451fd133043e1f70f356a7f76c83b39 100644 (file)
@@ -1,6 +1,7 @@
 #include <windows.h>
 #include <msp/graphics/window_private.h>
 #include "keyboard.h"
+#include "keys.h"
 #include "keys_private.h"
 
 #define MAPVK_VK_TO_VSC 0
@@ -10,7 +11,7 @@ namespace Input {
 
 std::string Keyboard::get_button_name(unsigned btn) const
 {
-       if(btn==0)
+       if(btn==KEY_NONE)
                return "None";
 
        char buf[128];
index 50142c93afb1666b8d83264f2448c18efd4254b6..68247e4d3cd413880665b204a323818f39a10478 100644 (file)
@@ -2,6 +2,7 @@
 #include <X11/Xutil.h>
 #include <msp/graphics/window_private.h>
 #include "keyboard.h"
+#include "keys.h"
 #include "keys_private.h"
 
 namespace Msp {
@@ -9,7 +10,7 @@ namespace Input {
 
 std::string Keyboard::get_button_name(unsigned btn) const
 {
-       if(btn==0)
+       if(btn==KEY_NONE)
                return "None";
 
        const char *str = XKeysymToString(key_to_sys(btn));