Touchscreen(Graphics::Window &);
~Touchscreen();
+ static bool is_available();
+
Graphics::Window &get_window() const { return window; }
virtual std::string get_button_name(unsigned) const;
namespace Msp {
namespace Input {
+bool Touchscreen::is_available()
+{
+ // Must have at least Windows 7 (WinNT 6.1) for WM_TOUCHMOVE
+ OSVERSIONINFOEX version;
+ version.dwOSVersionInfoSize = sizeof(version);
+ version.dwMajorVersion = 6;
+ version.dwMinorVersion = 1;
+ version.dwServicePackMajor = 0;
+ version.dwServicePackMinor = 0;
+ DWORD mask = VER_MAJORVERSION|VER_MINORVERSION|VER_SERVICEPACKMAJOR|VER_SERVICEPACKMINOR;
+ DWORDLONG cond = VerSetConditionMask(0, mask, VER_GREATER_EQUAL);
+ if(!VerifyVersionInfo(&version, type, cond))
+ return false;
+
+ if(!GetSystemMetrics(SM_TABLETPC))
+ return false;
+ if(!(GetSystemMetrics(SM_DIGITIZER)&NID_READY))
+ return false;
+
+ return true;
+}
+
void Touchscreen::input_event(const Graphics::Window::Event &event)
{
if(event.msg==WM_TOUCHMOVE)