-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsettings.def.h
27 lines (24 loc) · 916 Bytes
/
settings.def.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
#pragma once
// Do not remove this. This variable is initialized in main program
extern CGSize screenSize;
// Emit mouse event or wrap cursor. Default is warp cursor
bool emitMouseEvent = false;
// Helper function: lower and upper has to be without 0 to 1 inclusive
static inline double rangeRatio(double n, double lower, double upper) {
if (n < lower || n > upper) {
return -1;
}
return (n - lower) / (upper - lower);
}
// Compulsory: Modify this function to change how relative position of trackpad is mapped to normalized screen coordinates. Return negative number for invalid finger position
static inline MTPoint map(double normx, double normy) {
// whole trackpad to whole screen
MTPoint point = {
.x = normx,
.y = normy,
};
//scaling the points up to the screen size
point.x *= screenSize.width;
point.y *= screenSize.height;
return point;
}