Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #3 from mazbox/master

Now you can use the listener interface properly.
  • Loading branch information...
commit b8f72637ff795f74d3943f22bc86c0fb04b21cef 2 parents 25384ae + 1ce6d19
jens alexander ewald authored
Showing with 9 additions and 7 deletions.
  1. +9 −7 src/ofxMultiTouchPad.cpp
View
16 src/ofxMultiTouchPad.cpp
@@ -162,16 +162,18 @@ void ofxMultiTouchPad::getTouchesAsOfPoints(std::vector<ofPoint> * pointv){
// ------------------------------------------------------------- protected
void ofxMultiTouchPad::callBackTriggered(TouchFrame & _t)
{
- if (_touchData.count < _t.count) {
+ int oldTouchCount = _touchData.count;
+ _touchData = _t;
+
+ if (oldTouchCount < _t.count) {
/*
TODO: extract the new touch and pass its ID
*/
ofNotifyEvent(touchAdded, _t.count, this);
- }
- if (_touchData.count > _t.count) {
+ } else if (_touchData.count > _t.count) {
ofNotifyEvent(touchRemoved, _t.count, this);
- }
- _touchData = _t;
-// printf("update listener called\n");
- ofNotifyEvent(update, _touchData.count, this);
+ } else {
+ // printf("update listener called\n");
+ ofNotifyEvent(update, _touchData.count, this);
+ }
}

0 comments on commit b8f7263

Please sign in to comment.
Something went wrong with that request. Please try again.