node-mac-recorder 2.22.12 → 2.22.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/cursor_tracker.mm +24 -0
package/package.json
CHANGED
package/src/cursor_tracker.mm
CHANGED
|
@@ -2091,6 +2091,23 @@ CGEventRef eventCallback(CGEventTapProxy proxy, CGEventType type, CGEventRef eve
|
|
|
2091
2091
|
// Event tipini belirle
|
|
2092
2092
|
switch (type) {
|
|
2093
2093
|
case kCGEventLeftMouseDown:
|
|
2094
|
+
eventType = @"mousedown";
|
|
2095
|
+
// Odak/caret çoğu uygulamada tıklamadan hemen sonra oluşur; kısa gecikmeyle AX caret yaz.
|
|
2096
|
+
// (Sadece tuşta emit edilince ilk tıkta timeline'da textInput olmuyordu.)
|
|
2097
|
+
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.028 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
2098
|
+
if (!g_isCursorTracking || !g_trackingStartTime || !g_fileHandle) return;
|
|
2099
|
+
NSDate *now = [NSDate date];
|
|
2100
|
+
NSTimeInterval ts = [now timeIntervalSinceDate:g_trackingStartTime] * 1000.0;
|
|
2101
|
+
NSTimeInterval unixMs = [now timeIntervalSince1970] * 1000.0;
|
|
2102
|
+
CGPoint loc = CGPointZero;
|
|
2103
|
+
CGEventRef posEv = CGEventCreate(NULL);
|
|
2104
|
+
if (posEv) {
|
|
2105
|
+
loc = CGEventGetLocation(posEv);
|
|
2106
|
+
CFRelease(posEv);
|
|
2107
|
+
}
|
|
2108
|
+
emitTextInputEvent(ts, unixMs, loc);
|
|
2109
|
+
});
|
|
2110
|
+
break;
|
|
2094
2111
|
case kCGEventRightMouseDown:
|
|
2095
2112
|
case kCGEventOtherMouseDown:
|
|
2096
2113
|
eventType = @"mousedown";
|
|
@@ -2164,6 +2181,13 @@ void cursorTimerCallback() {
|
|
|
2164
2181
|
cursorType = @"default";
|
|
2165
2182
|
}
|
|
2166
2183
|
|
|
2184
|
+
// Timer-only mod: CGEventTap yokken kCGEventKeyDown gelmez; caret satırları hiç yazılmazdı.
|
|
2185
|
+
// I-beam görünürken AX ile periyodik textInput üret (emitTextInputEvent içinde throttle var).
|
|
2186
|
+
if ([cursorType isEqualToString:@"text"] ||
|
|
2187
|
+
[cursorType isEqualToString:@"vertical-text"]) {
|
|
2188
|
+
emitTextInputEvent(timestamp, unixTimeMs, location);
|
|
2189
|
+
}
|
|
2190
|
+
|
|
2167
2191
|
// Mouse button state polling — event tap olmadığında click/drag tespiti
|
|
2168
2192
|
bool currentLeftMouseDown = CGEventSourceButtonState(kCGEventSourceStateHIDSystemState, kCGMouseButtonLeft);
|
|
2169
2193
|
bool currentRightMouseDown = CGEventSourceButtonState(kCGEventSourceStateHIDSystemState, kCGMouseButtonRight);
|