forked from pilotmoon/Scroll-Reverser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMouseTap.h
44 lines (35 loc) · 1.09 KB
/
MouseTap.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// This file is part of Scroll Reverser <https://pilotmoon.com/scrollreverser/>
// Licensed under Apache License v2.0 <http://www.apache.org/licenses/LICENSE-2.0>
#import <Foundation/Foundation.h>
// The possible sources of scrolling events.
typedef enum {
ScrollEventSourceMouse=0,
ScrollEventSourceTrackpad,
ScrollEventSourceTablet,
ScrollEventSourceMax
} ScrollEventSource;
// We abstract the system defined scrolling phases into these possibilities.
typedef enum {
ScrollPhaseStart=0,
ScrollPhaseNormal, // fingers on pad
ScrollPhaseMomentum, // fingers off pad, but scrolling with momentum
ScrollPhaseEnd, // scrolling ended
ScrollPhaseMax
} ScrollPhase;
@class MouseTap, TapLogger;
@interface MouseTap : NSObject {
CFMachPortRef activeTapPort;
CFRunLoopSourceRef activeTapSource;
CFMachPortRef passiveTapPort;
CFRunLoopSourceRef passiveTapSource;
@public
NSUInteger touching;
uint64_t lastTouchTime;
ScrollEventSource lastSource;
__weak TapLogger *logger;
}
- (void)start;
- (void)stop;
- (void)enableTap;
- (void)resetTap;
@end