]> git.tdb.fi Git - libs/gui.git/blobdiff - source/input/touchscreen.cpp
Update .gitignore to include build products on Windows
[libs/gui.git] / source / input / touchscreen.cpp
index 95fd272200b03802e43d517f01af99ca1ec49831..f2e06f6bd49f463b56ff0b37ac39e8b4a3762d73 100644 (file)
@@ -6,8 +6,12 @@ namespace Msp {
 namespace Input {
 
 Touchscreen::Touchscreen(Graphics::Window &w):
+       Device(TOUCH_SURFACE),
        window(w)
 {
+       if(!is_available())
+               throw device_not_available("Touchscreen");
+
        name = "Touchscreen";
 
        window.set_touch_input(true);
@@ -72,7 +76,7 @@ void Touchscreen::touch_move(unsigned id, float x, float y)
 void Touchscreen::touch_up(unsigned id)
 {
        unsigned i = map_point_id(id);
-       set_button_state(i, true, false);
+       set_button_state(i, false, true);
        active_points[i] = UNUSED;
 }