--- /dev/null
+#include <msp/input/keys.h>
+#include "root.h"
+#include "systemkeyboardinput.h"
+
+namespace Msp {
+namespace GLtk {
+
+SystemKeyboardInput::SystemKeyboardInput(Root &r, Input::Keyboard &k):
+ InputMethod(r),
+ keyboard(k)
+{
+ keyboard.signal_button_press.connect(sigc::mem_fun(this, &SystemKeyboardInput::key_press));
+ keyboard.signal_button_release.connect(sigc::mem_fun(this, &SystemKeyboardInput::key_release));
+ keyboard.signal_character.connect(sigc::mem_fun(this, &SystemKeyboardInput::character));
+}
+
+bool SystemKeyboardInput::key_press(unsigned key)
+{
+ // TODO modifiers
+ if(root.key_press(key, 0))
+ return true;
+
+ return false;
+}
+
+bool SystemKeyboardInput::key_release(unsigned key)
+{
+ return root.key_release(key, 0);
+}
+
+bool SystemKeyboardInput::character(StringCodec::unichar ch)
+{
+ return root.character(ch);
+}
+
+} // namespace GLtk
+} // namespace Msp