Skip to content

Commit

Permalink
Support creation of smart magnify events
Browse files Browse the repository at this point in the history
Fixes #3282
  • Loading branch information
kriomant authored and cmsj committed Nov 12, 2024
1 parent fa58fd4 commit 844aa09
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions extensions/eventtap/TouchEvents.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ enum {
kTLInfoSubtypeMagnify = 0x08,
kTLInfoSubtypeGesture = 0x0B,
kTLInfoSubtypeSwipe = 0x10,
kTLInfoSubtypeSmartMagnify = 0x16,
kTLInfoSubtypeBeginGesture = 0x3D,
kTLInfoSubtypeEndGesture
};
Expand Down
6 changes: 6 additions & 0 deletions extensions/eventtap/libeventtap_event.m
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ static int eventtap_event_newEventFromData(lua_State* L) {
/// * `endSwipeUp` - End a swipe up.
/// * `beginSwipeDown` - Begin a swipe down.
/// * `endSwipeDown` - End a swipe down.
/// * `smartMagnify` - Performs smart mangify.
///
/// Examples:
/// ```lua
Expand Down Expand Up @@ -220,6 +221,11 @@ static int eventtap_event_newGesture(lua_State* L) {
@(magnification), kTLInfoKeyMagnification,
nil];
}
else if ([gesture isEqualToString:@"smartMagnify"]) {
gestureDict = [NSDictionary dictionaryWithObjectsAndKeys:
@(kTLInfoSubtypeSmartMagnify), kTLInfoKeyGestureSubtype,
nil];
}
else if ([gesture isEqualToString:@"beginRotate"]) {
NSNumber *rotationValue = [skin toNSObjectAtIndex:2];
double rotation = 0.0;
Expand Down

0 comments on commit 844aa09

Please sign in to comment.