]> git.tdb.fi Git - libs/gui.git/blobdiff - source/input/x11/keyboard.cpp
Use nullptr in place of 0 or NULL
[libs/gui.git] / source / input / x11 / keyboard.cpp
index 50142c93afb1666b8d83264f2448c18efd4254b6..00b6448e316bf84232fc64e0245e3c4010abe209 100644 (file)
@@ -1,7 +1,8 @@
+#include "keyboard.h"
 #include <X11/Xlib.h>
 #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));
@@ -32,7 +33,7 @@ void Keyboard::input_event(const Graphics::Window::Event &event)
                        if(event.xevent.type==KeyPress)
                        {
                                char ch;
-                               if(XLookupString(const_cast<XKeyEvent *>(&event.xevent.xkey), &ch, 1, 0, 0))
+                               if(XLookupString(const_cast<XKeyEvent *>(&event.xevent.xkey), &ch, 1, nullptr, nullptr))
                                        // XLookupString always returns Latin-1
                                        signal_character.emit(static_cast<unsigned char>(ch));
                        }