#include <msp/input/keyboard.h>
#include <msp/input/mouse.h>
#include <msp/io/print.h>
+#include <msp/stringcodec/codec.h>
+#include <msp/stringcodec/utf8.h>
using namespace Msp;
void key_press(unsigned);
void key_release(unsigned);
+ void character(StringCodec::unichar);
void button_press(unsigned);
void button_release(unsigned);
void axis_motion(unsigned, float, float);
window.signal_close.connect(sigc::bind(sigc::mem_fun(this, &Ev::exit), 0));
keyboard.signal_button_press.connect(sigc::mem_fun(this, &Ev::key_press));
keyboard.signal_button_release.connect(sigc::mem_fun(this, &Ev::key_release));
+ keyboard.signal_character.connect(sigc::mem_fun(this, &Ev::character));
mouse.signal_button_press.connect(sigc::mem_fun(this, &Ev::button_press));
mouse.signal_button_release.connect(sigc::mem_fun(this, &Ev::button_release));
mouse.signal_axis_motion.connect(sigc::mem_fun(this, &Ev::axis_motion));
IO::print("key_release: %s\n", keyboard.get_button_name(key));
}
+void Ev::character(StringCodec::unichar ch)
+{
+ IO::print("character: %s\n", StringCodec::encode<StringCodec::Utf8>(StringCodec::ustring(1, ch)));
+}
+
void Ev::button_press(unsigned btn)
{
IO::print("button_press: %s\n", mouse.get_button_name(btn));