summaryrefslogtreecommitdiff
path: root/CyteKit/dispatchEvent.mm
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2011-03-13 16:03:27 -0700
committerJay Freeman (saurik) <saurik@saurik.com>2011-03-14 05:09:10 -0700
commitea5bf5ccf084c34aaf358b4b197b88ea4143a695 (patch)
treef29174581b0db45685a5799ab397e313c229d04d /CyteKit/dispatchEvent.mm
parent94179461c92b5ef8ed7dab0c02ac626b1899b026 (diff)
Add WebEventTouchCancel, using WebEvent.h.
Diffstat (limited to 'CyteKit/dispatchEvent.mm')
-rw-r--r--CyteKit/dispatchEvent.mm14
1 files changed, 11 insertions, 3 deletions
diff --git a/CyteKit/dispatchEvent.mm b/CyteKit/dispatchEvent.mm
index f0e79ad..76e24af 100644
--- a/CyteKit/dispatchEvent.mm
+++ b/CyteKit/dispatchEvent.mm
@@ -40,6 +40,8 @@
#include "CyteKit/dispatchEvent.h"
#include "CyteKit/WebThreadLocked.hpp"
+#include <WebCore/WebEvent.h>
+
#include <WebKit/WebFrame.h>
#include <WebKit/WebScriptObject.h>
#include <WebKit/WebView.h>
@@ -78,9 +80,15 @@
MSHook(void, UIWebBrowserView$_webTouchEventsRecognized$, UIWebBrowserView *self, SEL _cmd, UIWebTouchEventsGestureRecognizer *recognizer) {
_UIWebBrowserView$_webTouchEventsRecognized$(self, _cmd, recognizer);
- if ([recognizer type] == 8)
- //if ([[recognizer _typeDescription] isEqualToString:@"WebEventTouchEnd"])
- [self dispatchEvent:@"CydiaTouchEnd"];
+ switch ([recognizer type]) {
+ case WebEventTouchEnd:
+ [self dispatchEvent:@"CydiaTouchEnd"];
+ break;
+
+ case WebEventTouchCancel:
+ [self dispatchEvent:@"CydiaTouchCancel"];
+ break;
+ }
}
__attribute__((__constructor__)) static void $() {