[aseprite] 43/128: Add she::PointerType::Cursor to identify puck like devices

Tobias Hansen thansen at moszumanska.debian.org
Mon May 9 21:24:21 UTC 2016


This is an automated email from the git hooks/post-receive script.

thansen pushed a commit to branch master
in repository aseprite.

commit 119c87873f4660e4553aecc0d4ad2ae59e016fa5
Author: David Capello <davidcapello at gmail.com>
Date:   Thu Apr 21 13:12:03 2016 -0300

    Add she::PointerType::Cursor to identify puck like devices
---
 src/she/pointer_type.h | 10 ++++++----
 src/she/win/window.h   | 20 ++++++++++++++++----
 2 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/src/she/pointer_type.h b/src/she/pointer_type.h
index 7e4f2c7..ad42d00 100644
--- a/src/she/pointer_type.h
+++ b/src/she/pointer_type.h
@@ -10,12 +10,14 @@
 
 namespace she {
 
+  // Source of a mouse like event
   enum class PointerType {
     Unknown,
-    Mouse,
-    Multitouch,
-    Pen,
-    Eraser
+    Mouse,                      // A regular mouse
+    Multitouch,                 // Trackpad/multitouch surface
+    Pen,                        // Stylus pen
+    Cursor,                     // Puck like device
+    Eraser                      // Eraser end of a stylus pen
   };
 
 } // namespace she
diff --git a/src/she/win/window.h b/src/she/win/window.h
index 00c0096..9e5f4f5 100644
--- a/src/she/win/window.h
+++ b/src/she/win/window.h
@@ -624,10 +624,22 @@ namespace she {
           PACKET packet;
 
           if (api.packet(ctx, serial, &packet)) {
-            if (packet.pkCursor == 2 || packet.pkCursor == 5)
-              m_pointerType = PointerType::Eraser;
-            else
-              m_pointerType = PointerType::Pen;
+            switch (packet.pkCursor) {
+              case 0:
+              case 3:
+                m_pointerType = PointerType::Cursor;
+                break;
+              case 1:
+              case 4:
+                m_pointerType = PointerType::Pen;
+                break;
+              case 2
+              case 5:
+                m_pointerType = PointerType::Eraser;
+                break;
+              default:
+                m_pointerType = PointerType::Unknown;
+                break;
           }
           else
             m_pointerType = PointerType::Unknown;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git



More information about the Pkg-games-commits mailing list