summaryrefslogtreecommitdiff
path: root/src/memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/memory.c')
-rw-r--r--src/memory.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/memory.c b/src/memory.c
index 7d8cda8..9084502 100644
--- a/src/memory.c
+++ b/src/memory.c
@@ -46,11 +46,11 @@ void init_memory(struct Memory *mem)
46/** 46/**
47 * update_configuration 47 * update_configuration
48 * 48 *
49 * Update the same, fingers, added memory variables. 49 * Update the same, fingers, added, and thumb memory variables.
50 * 50 *
51 * Precondition: none 51 * Precondition: none
52 * 52 *
53 * Postcondition: same, fingers, added are set 53 * Postcondition: same, fingers, added, thumb are set
54 * 54 *
55 */ 55 */
56static void update_configuration(struct Memory *m, 56static void update_configuration(struct Memory *m,
@@ -66,6 +66,11 @@ static void update_configuration(struct Memory *m,
66 SETBIT(m->added, i); 66 SETBIT(m->added, i);
67 m->same = m->fingers == fingers && m->added == 0; 67 m->same = m->fingers == fingers && m->added == 0;
68 m->fingers = fingers; 68 m->fingers = fingers;
69 if (!m->same)
70 m->thumb = 0;
71 foreach_bit(i, fingers)
72 if (f[i].thumb)
73 SETBIT(m->thumb, i);
69} 74}
70 75
71/** 76/**
@@ -73,7 +78,7 @@ static void update_configuration(struct Memory *m,
73 * 78 *
74 * Update the pointing and ybar memory variables. 79 * Update the pointing and ybar memory variables.
75 * 80 *
76 * Precondition: fingers, added are set 81 * Precondition: fingers, added, thumb are set
77 * 82 *
78 * Postcondition: pointing, ybar are set 83 * Postcondition: pointing, ybar are set
79 * 84 *
@@ -121,7 +126,7 @@ static void update_pointers(struct Memory *m,
121 * When moving is nonzero, gestures can be extracted from the dx and dy 126 * When moving is nonzero, gestures can be extracted from the dx and dy
122 * variables. These variables should be cleared after use. 127 * variables. These variables should be cleared after use.
123 * 128 *
124 * Precondition: fingers, added, pointing are set 129 * Precondition: fingers, added, thumb, pointing are set
125 * 130 *
126 * Postcondition: pending, moving, mvhold, mvforget, dx, dy are set 131 * Postcondition: pending, moving, mvhold, mvforget, dx, dy are set
127 * 132 *