X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Finput%2Ftouchscreen.cpp;h=c4de688a76d32efddcf3905f7a4bdeded22e204b;hb=69aaca13ae0949acf12056e390cbd1009a8487b2;hp=95fd272200b03802e43d517f01af99ca1ec49831;hpb=1d7113259625a91f5f6d2f53365aad22ae744689;p=libs%2Fgui.git diff --git a/source/input/touchscreen.cpp b/source/input/touchscreen.cpp index 95fd272..c4de688 100644 --- a/source/input/touchscreen.cpp +++ b/source/input/touchscreen.cpp @@ -8,6 +8,9 @@ namespace Input { Touchscreen::Touchscreen(Graphics::Window &w): window(w) { + if(!is_available()) + throw device_not_available("Touchscreen"); + name = "Touchscreen"; window.set_touch_input(true); @@ -72,7 +75,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; }