From: Mikko Rasa Date: Tue, 30 Aug 2011 18:26:39 +0000 (+0300) Subject: Fall back to Device::get_*_name if name can't be determined X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=5ccbbe9ba2daa4d5f0c047be022f6cfeec946598;p=libs%2Fgui.git Fall back to Device::get_*_name if name can't be determined --- diff --git a/source/input/keyboard.cpp b/source/input/keyboard.cpp index 5b54ee4..0f4d4ab 100644 --- a/source/input/keyboard.cpp +++ b/source/input/keyboard.cpp @@ -8,7 +8,6 @@ #include #include #include -#include #include "keyboard.h" #include "keys.h" @@ -34,13 +33,13 @@ std::string Keyboard::get_button_name(unsigned btn) const #ifndef WIN32 const char *str = XKeysymToString(key_to_sys(btn)); if(!str) - return format("Key %d", btn); + return Device::get_button_name(btn); return str; #else char buf[128]; unsigned scan = MapVirtualKey(key_to_sys(btn), MAPVK_VK_TO_VSC); if(!GetKeyNameText(scan<<16, buf, sizeof(buf))) - return format("Key %d", btn); + return Device::get_button_name(btn); return buf; #endif } diff --git a/source/input/mouse.cpp b/source/input/mouse.cpp index cd89f94..fce870f 100644 --- a/source/input/mouse.cpp +++ b/source/input/mouse.cpp @@ -3,7 +3,6 @@ #endif #include #include -#include #include "mouse.h" namespace Msp { @@ -35,7 +34,7 @@ std::string Mouse::get_button_name(unsigned btn) const case 5: return "Wheel Down"; default: - return format("Button %d", btn); + return Device::get_button_name(btn); } } @@ -48,7 +47,7 @@ std::string Mouse::get_axis_name(unsigned axis) const case 1: return "Y axis"; default: - return format("Axis %d", axis); + return Device::get_axis_name(axis); }; }