--- /dev/null
+#include <windows.h>
+#include <msp/graphics/window_private.h>
+#include "keyboard.h"
+#include "keys_private.h"
+
+#define MAPVK_VK_TO_VSC 0
+
+namespace Msp {
+namespace Input {
+
+std::string Keyboard::get_button_name(unsigned btn) const
+{
+ if(btn==0)
+ return "None";
+
+ char buf[128];
+ unsigned scan = MapVirtualKey(key_to_sys(btn), MAPVK_VK_TO_VSC);
+ if(!GetKeyNameText(scan<<16, buf, sizeof(buf)))
+ return Device::get_button_name(btn);
+ return buf;
+}
+
+void Keyboard::input_event(const Graphics::Window::Event &event)
+{
+ switch(event.msg)
+ {
+ case WM_KEYDOWN:
+ case WM_KEYUP:
+ set_button_state(key_from_sys(event.wparam), event.msg==WM_KEYDOWN, true);
+ break;
+ case WM_CHAR:
+ signal_character.emit(event.wparam);
+ break;
+ }
+}
+
+} // namespace Input
+} // namespace Msp