node-mac-recorder 2.16.10 โ 2.16.12
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/.claude/settings.local.json +1 -1
- package/CLAUDE.md +51 -3
- package/package.json +1 -1
- package/src/avfoundation_recorder.mm +85 -55
- package/src/mac_recorder.mm +49 -57
- package/bring-to-front-test.js +0 -159
- package/capture-test.js +0 -87
- package/cursor-test.js +0 -22
- package/debug-test.js +0 -95
- package/default-auto-front-test.js +0 -86
- package/final-multi-display-test.js +0 -74
- package/list-test.js +0 -46
- package/quick-cursor-test.js +0 -20
- package/quick-screen-test.js +0 -34
- package/quick-test.js +0 -35
- package/system-sound-test.js +0 -46
- package/test-audio-controls.js +0 -104
- package/test-both.js +0 -46
- package/test-console-logs.js +0 -81
- package/test-coordinate-debug.js +0 -25
- package/test-cursor-visible.js +0 -41
- package/test-electron-detection.js +0 -44
- package/test-final-coordinate-fix.js +0 -38
- package/test-hybrid.js +0 -53
- package/test-macos14-forced.js +0 -107
- package/test-macos14.js +0 -56
- package/test-multi-display-overlay.js +0 -185
- package/test-multi-screen-selection.js +0 -171
- package/test-multidisplay-fix.js +0 -120
- package/test-native-cursor.js +0 -31
- package/test-overlay-tracking.js +0 -175
- package/test-primary-live.js +0 -17
- package/test-primary-window-debug.js +0 -33
- package/test-quick.js +0 -55
- package/test-real-screen-ids.js +0 -32
- package/test-screencapture-only.js +0 -50
- package/test-screencapture-pure.js +0 -69
- package/test-screencapture.js +0 -52
- package/test-system-audio.js +0 -104
- package/test-window-selector-fix.js +0 -88
- package/window-selector-test.js +0 -160
package/bring-to-front-test.js
DELETED
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const WindowSelector = require('./window-selector');
|
|
4
|
-
|
|
5
|
-
async function testBringToFront() {
|
|
6
|
-
console.log('๐ Bring To Front Test');
|
|
7
|
-
console.log('======================\n');
|
|
8
|
-
|
|
9
|
-
const selector = new WindowSelector();
|
|
10
|
-
|
|
11
|
-
try {
|
|
12
|
-
// Test 1: Manual bring to front
|
|
13
|
-
console.log('๐ Test 1: Manual window bring-to-front');
|
|
14
|
-
console.log('Move cursor over a window and press SPACE to bring it to front\n');
|
|
15
|
-
|
|
16
|
-
let currentWindow = null;
|
|
17
|
-
|
|
18
|
-
selector.on('windowEntered', (window) => {
|
|
19
|
-
currentWindow = window;
|
|
20
|
-
console.log(`\n๐ Window: ${window.appName} - "${window.title}" (ID: ${window.id})`);
|
|
21
|
-
console.log(' ๐ Position:', `(${window.x}, ${window.y})`);
|
|
22
|
-
console.log(' ๐ Size:', `${window.width} ร ${window.height}`);
|
|
23
|
-
console.log(' ๐ก Press SPACE to bring this window to front');
|
|
24
|
-
console.log(' ๐ก Press A to enable AUTO bring-to-front');
|
|
25
|
-
console.log(' ๐ก Press D to disable AUTO bring-to-front');
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
selector.on('windowLeft', (window) => {
|
|
29
|
-
console.log(`๐ช Left: ${window.appName} - "${window.title}"`);
|
|
30
|
-
currentWindow = null;
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
// Keyboard controls
|
|
34
|
-
const readline = require('readline');
|
|
35
|
-
readline.emitKeypressEvents(process.stdin);
|
|
36
|
-
if (process.stdin.isTTY) {
|
|
37
|
-
process.stdin.setRawMode(true);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
process.stdin.on('keypress', async (str, key) => {
|
|
41
|
-
if (key.name === 'space' && currentWindow) {
|
|
42
|
-
console.log(`\n๐ Bringing window to front: ${currentWindow.appName} - "${currentWindow.title}"`);
|
|
43
|
-
try {
|
|
44
|
-
const success = await selector.bringWindowToFront(currentWindow.id);
|
|
45
|
-
if (success) {
|
|
46
|
-
console.log(' โ
Window brought to front successfully!');
|
|
47
|
-
} else {
|
|
48
|
-
console.log(' โ Failed to bring window to front');
|
|
49
|
-
}
|
|
50
|
-
} catch (error) {
|
|
51
|
-
console.log(' โ Error:', error.message);
|
|
52
|
-
}
|
|
53
|
-
} else if (key.name === 'a') {
|
|
54
|
-
console.log('\n๐ Enabling AUTO bring-to-front mode...');
|
|
55
|
-
selector.setBringToFrontEnabled(true);
|
|
56
|
-
console.log(' โ
Auto mode ON - Windows will come to front automatically');
|
|
57
|
-
} else if (key.name === 'd') {
|
|
58
|
-
console.log('\n๐ Disabling AUTO bring-to-front mode...');
|
|
59
|
-
selector.setBringToFrontEnabled(false);
|
|
60
|
-
console.log(' โ
Auto mode OFF - Manual control only');
|
|
61
|
-
} else if (key.ctrl && key.name === 'c') {
|
|
62
|
-
process.exit(0);
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
console.log('๐ Starting window selection...\n');
|
|
67
|
-
console.log('๐ Controls:');
|
|
68
|
-
console.log(' SPACE - Bring current window to front');
|
|
69
|
-
console.log(' A - Enable AUTO bring-to-front');
|
|
70
|
-
console.log(' D - Disable AUTO bring-to-front');
|
|
71
|
-
console.log(' Ctrl+C - Exit\n');
|
|
72
|
-
|
|
73
|
-
await selector.startSelection();
|
|
74
|
-
|
|
75
|
-
// Keep running
|
|
76
|
-
process.on('SIGINT', async () => {
|
|
77
|
-
console.log('\n๐ Stopping...');
|
|
78
|
-
await selector.cleanup();
|
|
79
|
-
process.exit(0);
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
// Prevent exit
|
|
83
|
-
setInterval(() => {}, 1000);
|
|
84
|
-
|
|
85
|
-
} catch (error) {
|
|
86
|
-
console.error('โ Error:', error.message);
|
|
87
|
-
console.error(error.stack);
|
|
88
|
-
} finally {
|
|
89
|
-
// Cleanup
|
|
90
|
-
await selector.cleanup();
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
async function testAutoBringToFront() {
|
|
95
|
-
console.log('๐ค Auto Bring To Front Test');
|
|
96
|
-
console.log('============================\n');
|
|
97
|
-
|
|
98
|
-
const selector = new WindowSelector();
|
|
99
|
-
|
|
100
|
-
try {
|
|
101
|
-
// Enable auto bring-to-front
|
|
102
|
-
console.log('๐ Enabling auto bring-to-front...');
|
|
103
|
-
selector.setBringToFrontEnabled(true);
|
|
104
|
-
|
|
105
|
-
let windowCount = 0;
|
|
106
|
-
|
|
107
|
-
selector.on('windowEntered', (window) => {
|
|
108
|
-
windowCount++;
|
|
109
|
-
console.log(`\n[${windowCount}] ๐ AUTO FRONT: ${window.appName} - "${window.title}"`);
|
|
110
|
-
console.log(` ๐ Position: (${window.x}, ${window.y})`);
|
|
111
|
-
console.log(` ๐ Size: ${window.width} ร ${window.height}`);
|
|
112
|
-
console.log(' ๐ Window should automatically come to front!');
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
console.log('โ
Auto bring-to-front enabled');
|
|
116
|
-
console.log('๐ฑ๏ธ Move cursor over different windows');
|
|
117
|
-
console.log('๐ Each window should automatically come to front');
|
|
118
|
-
console.log('โฑ๏ธ Test will run for 30 seconds\n');
|
|
119
|
-
|
|
120
|
-
await selector.startSelection();
|
|
121
|
-
|
|
122
|
-
// Auto-stop after 30 seconds
|
|
123
|
-
setTimeout(async () => {
|
|
124
|
-
console.log('\nโฐ Test completed!');
|
|
125
|
-
console.log(`๐ Total windows auto-focused: ${windowCount}`);
|
|
126
|
-
selector.setBringToFrontEnabled(false);
|
|
127
|
-
await selector.cleanup();
|
|
128
|
-
process.exit(0);
|
|
129
|
-
}, 30000);
|
|
130
|
-
|
|
131
|
-
} catch (error) {
|
|
132
|
-
console.error('โ Error:', error.message);
|
|
133
|
-
await selector.cleanup();
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
// Main function
|
|
138
|
-
async function main() {
|
|
139
|
-
const args = process.argv.slice(2);
|
|
140
|
-
|
|
141
|
-
if (args.includes('--auto')) {
|
|
142
|
-
await testAutoBringToFront();
|
|
143
|
-
} else if (args.includes('--help')) {
|
|
144
|
-
console.log('Bring To Front Tests:');
|
|
145
|
-
console.log('====================');
|
|
146
|
-
console.log('node bring-to-front-test.js [option]');
|
|
147
|
-
console.log('');
|
|
148
|
-
console.log('Options:');
|
|
149
|
-
console.log(' --manual Manual bring-to-front test (default)');
|
|
150
|
-
console.log(' --auto Auto bring-to-front test');
|
|
151
|
-
console.log(' --help Show this help');
|
|
152
|
-
} else {
|
|
153
|
-
await testBringToFront();
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
if (require.main === module) {
|
|
158
|
-
main().catch(console.error);
|
|
159
|
-
}
|
package/capture-test.js
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
const MacRecorder = require("./");
|
|
2
|
-
const fs = require("fs");
|
|
3
|
-
const path = require("path");
|
|
4
|
-
|
|
5
|
-
async function saveBase64Image(base64String, filePath) {
|
|
6
|
-
// Remove the data:image/png;base64, prefix if it exists
|
|
7
|
-
const base64Data = base64String.replace(/^data:image\/png;base64,/, "");
|
|
8
|
-
|
|
9
|
-
// Create directory if it doesn't exist
|
|
10
|
-
const dir = path.dirname(filePath);
|
|
11
|
-
if (!fs.existsSync(dir)) {
|
|
12
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
// Write the file
|
|
16
|
-
fs.writeFileSync(filePath, base64Data, "base64");
|
|
17
|
-
console.log(`โ
Saved image to: ${filePath}`);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
async function captureTest() {
|
|
21
|
-
const recorder = new MacRecorder();
|
|
22
|
-
|
|
23
|
-
// Create output directory
|
|
24
|
-
const outputDir = path.join(__dirname, "thumbnails");
|
|
25
|
-
if (!fs.existsSync(outputDir)) {
|
|
26
|
-
fs.mkdirSync(outputDir, { recursive: true });
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
console.log("๐ธ Testing Display Capture");
|
|
30
|
-
|
|
31
|
-
// Get displays
|
|
32
|
-
const displays = await recorder.getDisplays();
|
|
33
|
-
console.log(`Found ${displays.length} displays`);
|
|
34
|
-
|
|
35
|
-
// Capture each display
|
|
36
|
-
for (const display of displays) {
|
|
37
|
-
console.log(
|
|
38
|
-
`\nCapturing display ${display.id} (${display.width}x${display.height})`
|
|
39
|
-
);
|
|
40
|
-
try {
|
|
41
|
-
const thumbnail = await recorder.getDisplayThumbnail(display.id, {
|
|
42
|
-
maxWidth: 800,
|
|
43
|
-
maxHeight: 600,
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
const fileName = `display_${display.id}.png`;
|
|
47
|
-
const filePath = path.join(outputDir, fileName);
|
|
48
|
-
await saveBase64Image(thumbnail, filePath);
|
|
49
|
-
} catch (error) {
|
|
50
|
-
console.error(`Failed to capture display ${display.id}:`, error);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
console.log("\n๐ธ Testing Window Capture");
|
|
55
|
-
|
|
56
|
-
// Get windows
|
|
57
|
-
const windows = await recorder.getWindows();
|
|
58
|
-
console.log(`Found ${windows.length} windows`);
|
|
59
|
-
|
|
60
|
-
// Capture each window
|
|
61
|
-
for (const window of windows) {
|
|
62
|
-
console.log(
|
|
63
|
-
`\nCapturing window "${window.appName}" (${window.width}x${window.height})`
|
|
64
|
-
);
|
|
65
|
-
try {
|
|
66
|
-
const thumbnail = await recorder.getWindowThumbnail(window.id, {
|
|
67
|
-
maxWidth: 800,
|
|
68
|
-
maxHeight: 600,
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
const fileName = `window_${window.id}_${window.appName.replace(
|
|
72
|
-
/[^a-z0-9]/gi,
|
|
73
|
-
"_"
|
|
74
|
-
)}.png`;
|
|
75
|
-
const filePath = path.join(outputDir, fileName);
|
|
76
|
-
await saveBase64Image(thumbnail, filePath);
|
|
77
|
-
} catch (error) {
|
|
78
|
-
console.error(`Failed to capture window "${window.appName}":`, error);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
console.log(
|
|
83
|
-
"\nโ
Test completed. Check the thumbnails directory for results."
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
captureTest().catch(console.error);
|
package/cursor-test.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
const MacRecorder = require("./index.js");
|
|
2
|
-
|
|
3
|
-
const recorder = new MacRecorder();
|
|
4
|
-
|
|
5
|
-
console.log("Starting cursor tracking test...");
|
|
6
|
-
console.log(
|
|
7
|
-
"Move your cursor around different applications to test cursor type detection"
|
|
8
|
-
);
|
|
9
|
-
console.log("The test will run for 10 seconds");
|
|
10
|
-
|
|
11
|
-
try {
|
|
12
|
-
recorder.startCursorCapture("./cursor-data.json");
|
|
13
|
-
|
|
14
|
-
setTimeout(() => {
|
|
15
|
-
recorder.stopCursorCapture();
|
|
16
|
-
console.log("Test completed. Check cursor-data.json for results");
|
|
17
|
-
process.exit(0);
|
|
18
|
-
}, 10000);
|
|
19
|
-
} catch (error) {
|
|
20
|
-
console.error("Error during cursor tracking:", error);
|
|
21
|
-
process.exit(1);
|
|
22
|
-
}
|
package/debug-test.js
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const WindowSelector = require('./window-selector');
|
|
4
|
-
|
|
5
|
-
async function debugTest() {
|
|
6
|
-
console.log('๐ Debug Window Selector Test');
|
|
7
|
-
console.log('==============================\n');
|
|
8
|
-
|
|
9
|
-
const selector = new WindowSelector();
|
|
10
|
-
|
|
11
|
-
try {
|
|
12
|
-
// ฤฐzinleri kontrol et
|
|
13
|
-
console.log('๐ Checking permissions...');
|
|
14
|
-
const permissions = await selector.checkPermissions();
|
|
15
|
-
console.log('Permissions:', JSON.stringify(permissions, null, 2));
|
|
16
|
-
|
|
17
|
-
if (!permissions.screenRecording || !permissions.accessibility) {
|
|
18
|
-
console.log('\nโ MISSING PERMISSIONS!');
|
|
19
|
-
console.log('Please enable in System Preferences > Security & Privacy:');
|
|
20
|
-
console.log(' โ Screen Recording - Add Terminal/your IDE');
|
|
21
|
-
console.log(' โ Accessibility - Add Terminal/your IDE');
|
|
22
|
-
console.log('\nAfter enabling permissions, restart this test.');
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
console.log('โ
Permissions OK\n');
|
|
27
|
-
|
|
28
|
-
// Debug mode ile baลlat
|
|
29
|
-
console.log('๐ Starting selection with debug info...');
|
|
30
|
-
await selector.startSelection();
|
|
31
|
-
|
|
32
|
-
let windowCount = 0;
|
|
33
|
-
|
|
34
|
-
selector.on('windowEntered', (window) => {
|
|
35
|
-
windowCount++;
|
|
36
|
-
console.log(`\n[${windowCount}] ๐ฏ WINDOW DETECTED:`);
|
|
37
|
-
console.log(` App: ${window.appName}`);
|
|
38
|
-
console.log(` Title: "${window.title}"`);
|
|
39
|
-
console.log(` ID: ${window.id}`);
|
|
40
|
-
console.log(` Position: (${window.x}, ${window.y})`);
|
|
41
|
-
console.log(` Size: ${window.width} ร ${window.height}`);
|
|
42
|
-
console.log(` ๐ Should auto-focus now...`);
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
selector.on('windowLeft', (window) => {
|
|
46
|
-
console.log(`\n๐ช LEFT WINDOW: ${window.appName} - "${window.title}"`);
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
selector.on('error', (error) => {
|
|
50
|
-
console.error('\nโ ERROR:', error.message);
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
console.log('๐ Test Instructions:');
|
|
54
|
-
console.log(' 1. Move cursor over different application windows');
|
|
55
|
-
console.log(' 2. You should see:');
|
|
56
|
-
console.log(' - Blue overlay rectangle around windows');
|
|
57
|
-
console.log(' - "Select Window" button in center');
|
|
58
|
-
console.log(' - Windows automatically coming to front');
|
|
59
|
-
console.log(' 3. If overlay not visible, check permissions');
|
|
60
|
-
console.log(' 4. Press Ctrl+C to exit\n');
|
|
61
|
-
console.log('๐ฑ๏ธ START MOVING CURSOR NOW...\n');
|
|
62
|
-
|
|
63
|
-
// Status monitoring
|
|
64
|
-
let statusCount = 0;
|
|
65
|
-
setInterval(() => {
|
|
66
|
-
statusCount++;
|
|
67
|
-
const status = selector.getStatus();
|
|
68
|
-
|
|
69
|
-
if (statusCount % 50 === 0) { // Every 5 seconds
|
|
70
|
-
console.log(`โฑ๏ธ Status Check #${statusCount/50}:`);
|
|
71
|
-
console.log(` - Selecting: ${status.isSelecting}`);
|
|
72
|
-
console.log(` - Windows found: ${status.nativeStatus?.windowCount || 0}`);
|
|
73
|
-
console.log(` - Overlay active: ${status.nativeStatus?.hasOverlay || false}`);
|
|
74
|
-
if (status.nativeStatus?.currentWindow) {
|
|
75
|
-
console.log(` - Current: ${status.nativeStatus.currentWindow.appName}`);
|
|
76
|
-
}
|
|
77
|
-
console.log('');
|
|
78
|
-
}
|
|
79
|
-
}, 100);
|
|
80
|
-
|
|
81
|
-
} catch (error) {
|
|
82
|
-
console.error('โ Fatal Error:', error.message);
|
|
83
|
-
console.error(error.stack);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// Handle Ctrl+C gracefully
|
|
88
|
-
process.on('SIGINT', async () => {
|
|
89
|
-
console.log('\n\n๐ Stopping debug test...');
|
|
90
|
-
process.exit(0);
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
if (require.main === module) {
|
|
94
|
-
debugTest();
|
|
95
|
-
}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const WindowSelector = require('./window-selector');
|
|
4
|
-
|
|
5
|
-
async function testDefaultAutoBringToFront() {
|
|
6
|
-
console.log('๐ Default Auto Bring-To-Front Test');
|
|
7
|
-
console.log('====================================\n');
|
|
8
|
-
|
|
9
|
-
const selector = new WindowSelector();
|
|
10
|
-
|
|
11
|
-
try {
|
|
12
|
-
console.log('๐ Starting window selector with DEFAULT auto bring-to-front...');
|
|
13
|
-
console.log('(Auto bring-to-front is now enabled by default)\n');
|
|
14
|
-
|
|
15
|
-
console.log('๐ Instructions:');
|
|
16
|
-
console.log(' โข Move cursor over different windows');
|
|
17
|
-
console.log(' โข Each window should automatically come to front');
|
|
18
|
-
console.log(' โข Only the specific window should focus (not whole app)');
|
|
19
|
-
console.log(' โข Press D to disable auto mode');
|
|
20
|
-
console.log(' โข Press E to re-enable auto mode');
|
|
21
|
-
console.log(' โข Press Ctrl+C to exit\n');
|
|
22
|
-
|
|
23
|
-
let windowCount = 0;
|
|
24
|
-
let lastWindowId = null;
|
|
25
|
-
|
|
26
|
-
selector.on('windowEntered', (window) => {
|
|
27
|
-
if (window.id !== lastWindowId) {
|
|
28
|
-
windowCount++;
|
|
29
|
-
console.log(`[${windowCount}] ๐ฏ WINDOW: ${window.appName} - "${window.title}"`);
|
|
30
|
-
console.log(` ๐ Position: (${window.x}, ${window.y})`);
|
|
31
|
-
console.log(` ๐ Size: ${window.width} ร ${window.height}`);
|
|
32
|
-
console.log(` ๐ Should auto-focus THIS specific window only!`);
|
|
33
|
-
lastWindowId = window.id;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
selector.on('windowLeft', (window) => {
|
|
38
|
-
console.log(`๐ช Left: ${window.appName} - "${window.title}"\n`);
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
// Keyboard controls
|
|
42
|
-
const readline = require('readline');
|
|
43
|
-
readline.emitKeypressEvents(process.stdin);
|
|
44
|
-
if (process.stdin.isTTY) {
|
|
45
|
-
process.stdin.setRawMode(true);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
process.stdin.on('keypress', async (str, key) => {
|
|
49
|
-
if (key.name === 'd') {
|
|
50
|
-
console.log('\n๐ Disabling auto bring-to-front...');
|
|
51
|
-
selector.setBringToFrontEnabled(false);
|
|
52
|
-
console.log(' โ
Auto mode OFF - Windows will not auto-focus');
|
|
53
|
-
} else if (key.name === 'e') {
|
|
54
|
-
console.log('\n๐ Enabling auto bring-to-front...');
|
|
55
|
-
selector.setBringToFrontEnabled(true);
|
|
56
|
-
console.log(' โ
Auto mode ON - Windows will auto-focus again');
|
|
57
|
-
} else if (key.ctrl && key.name === 'c') {
|
|
58
|
-
console.log('\n\n๐ Stopping...');
|
|
59
|
-
console.log(`๐ Total windows encountered: ${windowCount}`);
|
|
60
|
-
await selector.cleanup();
|
|
61
|
-
process.exit(0);
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
await selector.startSelection();
|
|
66
|
-
|
|
67
|
-
// Status update every 10 seconds
|
|
68
|
-
setInterval(() => {
|
|
69
|
-
console.log(`\nโฑ๏ธ Status: ${windowCount} windows encountered so far`);
|
|
70
|
-
console.log(' (Continue moving cursor over windows to test auto-focus)');
|
|
71
|
-
}, 10000);
|
|
72
|
-
|
|
73
|
-
// Keep running
|
|
74
|
-
setInterval(() => {}, 1000);
|
|
75
|
-
|
|
76
|
-
} catch (error) {
|
|
77
|
-
console.error('โ Error:', error.message);
|
|
78
|
-
console.error(error.stack);
|
|
79
|
-
} finally {
|
|
80
|
-
await selector.cleanup();
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
if (require.main === module) {
|
|
85
|
-
testDefaultAutoBringToFront();
|
|
86
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
const MacRecorder = require('./index');
|
|
2
|
-
const WindowSelector = MacRecorder.WindowSelector;
|
|
3
|
-
|
|
4
|
-
async function finalMultiDisplayTest() {
|
|
5
|
-
console.log('๐ FINAL Multi-Display Test');
|
|
6
|
-
console.log('='.repeat(40));
|
|
7
|
-
|
|
8
|
-
const recorder = new MacRecorder();
|
|
9
|
-
const displays = await recorder.getDisplays();
|
|
10
|
-
|
|
11
|
-
console.log('๐ Display Configuration:');
|
|
12
|
-
displays.forEach(display => {
|
|
13
|
-
console.log(` ${display.name}: (${display.x}, ${display.y}) ${display.width}x${display.height} ${display.isPrimary ? '[PRIMARY]' : ''}`);
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
console.log('\nโ
All coordinate fixes applied:');
|
|
17
|
-
console.log(' - Screen selector: Local coordinates for UI elements');
|
|
18
|
-
console.log(' - Window selector: Primary/secondary coordinate handling');
|
|
19
|
-
console.log(' - Display recording: Correct display ID mapping');
|
|
20
|
-
|
|
21
|
-
console.log('\n๐งช Testing window selector...');
|
|
22
|
-
console.log('๐ IMPORTANT: Test windows on BOTH displays');
|
|
23
|
-
console.log(' - Primary display: Should show buttons/UI correctly now');
|
|
24
|
-
console.log(' - Secondary display: Should continue working');
|
|
25
|
-
|
|
26
|
-
const selector = new WindowSelector();
|
|
27
|
-
|
|
28
|
-
try {
|
|
29
|
-
await selector.startSelection();
|
|
30
|
-
|
|
31
|
-
console.log('\nโฑ๏ธ Running for 30 seconds - test both displays thoroughly...');
|
|
32
|
-
await new Promise(resolve => setTimeout(resolve, 30000));
|
|
33
|
-
|
|
34
|
-
await selector.stopSelection();
|
|
35
|
-
|
|
36
|
-
console.log('โ
Window selector test completed!');
|
|
37
|
-
|
|
38
|
-
// Test recording on both displays
|
|
39
|
-
console.log('\n๐ฅ Testing recording on both displays...');
|
|
40
|
-
|
|
41
|
-
for (const display of displays) {
|
|
42
|
-
console.log(`\n๐น Testing ${display.name} recording...`);
|
|
43
|
-
|
|
44
|
-
try {
|
|
45
|
-
const outputPath = `./test-output/final-test-${display.id}.mov`;
|
|
46
|
-
|
|
47
|
-
await recorder.startRecording(outputPath, {
|
|
48
|
-
displayId: display.id,
|
|
49
|
-
captureCursor: true,
|
|
50
|
-
includeMicrophone: false,
|
|
51
|
-
includeSystemAudio: false
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
console.log(`โ
Recording started on ${display.name}`);
|
|
55
|
-
await new Promise(resolve => setTimeout(resolve, 2000));
|
|
56
|
-
|
|
57
|
-
await recorder.stopRecording();
|
|
58
|
-
console.log(`โ
Recording completed on ${display.name}`);
|
|
59
|
-
|
|
60
|
-
} catch (error) {
|
|
61
|
-
console.log(`โ Recording failed on ${display.name}: ${error.message}`);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
console.log('\n๐ ALL MULTI-DISPLAY TESTS COMPLETED!');
|
|
66
|
-
console.log('โ
Window selector should now work on both displays');
|
|
67
|
-
console.log('โ
Recording should work on both displays');
|
|
68
|
-
|
|
69
|
-
} catch (error) {
|
|
70
|
-
console.log(`โ Test failed: ${error.message}`);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
finalMultiDisplayTest();
|
package/list-test.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
const MacRecorder = require("./");
|
|
2
|
-
|
|
3
|
-
async function testListing() {
|
|
4
|
-
const recorder = new MacRecorder();
|
|
5
|
-
|
|
6
|
-
console.log("๐บ Testing Displays with Thumbnails");
|
|
7
|
-
const displays = await recorder.getDisplaysWithThumbnails({
|
|
8
|
-
maxWidth: 200,
|
|
9
|
-
maxHeight: 150,
|
|
10
|
-
});
|
|
11
|
-
console.log(`Found ${displays.length} displays:`);
|
|
12
|
-
for (const display of displays) {
|
|
13
|
-
console.log(`\nDisplay ID: ${display.id}`);
|
|
14
|
-
console.log(`Resolution: ${display.width}x${display.height}`);
|
|
15
|
-
console.log(`Position: (${display.x}, ${display.y})`);
|
|
16
|
-
console.log(`Primary: ${display.isPrimary}`);
|
|
17
|
-
console.log(
|
|
18
|
-
`Thumbnail included: ${display.thumbnail.substring(0, 50)}... (${
|
|
19
|
-
display.thumbnail.length
|
|
20
|
-
} chars)`
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
console.log("\n๐ช Testing Windows with Thumbnails");
|
|
25
|
-
const windows = await recorder.getWindowsWithThumbnails({
|
|
26
|
-
maxWidth: 200,
|
|
27
|
-
maxHeight: 150,
|
|
28
|
-
});
|
|
29
|
-
console.log(`Found ${windows.length} windows:`);
|
|
30
|
-
for (const window of windows.slice(0, 3)) {
|
|
31
|
-
// Just show first 3 for brevity
|
|
32
|
-
console.log(`\nWindow: ${window.appName}`);
|
|
33
|
-
console.log(`ID: ${window.id}`);
|
|
34
|
-
console.log(`Size: ${window.width}x${window.height}`);
|
|
35
|
-
console.log(
|
|
36
|
-
`Thumbnail included: ${window.thumbnail.substring(0, 50)}... (${
|
|
37
|
-
window.thumbnail.length
|
|
38
|
-
} chars)`
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
if (windows.length > 3) {
|
|
42
|
-
console.log(`\n... and ${windows.length - 3} more windows`);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
testListing().catch(console.error);
|
package/quick-cursor-test.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const MacRecorder = require('./index.js');
|
|
2
|
-
const recorder = new MacRecorder();
|
|
3
|
-
|
|
4
|
-
console.log('Starting 3-second cursor test...');
|
|
5
|
-
const testPath = 'quick-cursor-test.json';
|
|
6
|
-
|
|
7
|
-
// Start cursor tracking
|
|
8
|
-
const started = recorder.startCursorCapture(testPath);
|
|
9
|
-
if (started) {
|
|
10
|
-
console.log('Cursor tracking started, collecting data for 3 seconds...');
|
|
11
|
-
|
|
12
|
-
setTimeout(() => {
|
|
13
|
-
console.log('Stopping cursor tracking...');
|
|
14
|
-
recorder.stopCursorCapture();
|
|
15
|
-
console.log('Done! Check quick-cursor-test.json');
|
|
16
|
-
}, 3000);
|
|
17
|
-
} else {
|
|
18
|
-
console.log('Failed to start cursor tracking');
|
|
19
|
-
process.exit(1);
|
|
20
|
-
}
|
package/quick-screen-test.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const WindowSelector = require('./window-selector');
|
|
4
|
-
|
|
5
|
-
console.log('Starting screen selection...');
|
|
6
|
-
console.log('Click "Start Record" on ANY screen then this will show the result:');
|
|
7
|
-
|
|
8
|
-
const selector = new WindowSelector();
|
|
9
|
-
|
|
10
|
-
selector.startScreenSelection().then(() => {
|
|
11
|
-
console.log('Screen selection UI shown');
|
|
12
|
-
|
|
13
|
-
// Check every 500ms for selection
|
|
14
|
-
const checkInterval = setInterval(() => {
|
|
15
|
-
const selected = selector.getSelectedScreen();
|
|
16
|
-
if (selected) {
|
|
17
|
-
console.log('\n๐ SCREEN SELECTED!');
|
|
18
|
-
console.log('Selected data:', JSON.stringify(selected, null, 2));
|
|
19
|
-
clearInterval(checkInterval);
|
|
20
|
-
process.exit(0);
|
|
21
|
-
}
|
|
22
|
-
}, 500);
|
|
23
|
-
|
|
24
|
-
// Timeout after 15 seconds
|
|
25
|
-
setTimeout(() => {
|
|
26
|
-
console.log('\nโฐ Timeout - no screen selected');
|
|
27
|
-
clearInterval(checkInterval);
|
|
28
|
-
process.exit(1);
|
|
29
|
-
}, 15000);
|
|
30
|
-
|
|
31
|
-
}).catch(error => {
|
|
32
|
-
console.error('Error:', error.message);
|
|
33
|
-
process.exit(1);
|
|
34
|
-
});
|
package/quick-test.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const WindowSelector = require('./window-selector');
|
|
4
|
-
|
|
5
|
-
async function quickTest() {
|
|
6
|
-
console.log('๐งช Quick Window Selector Test');
|
|
7
|
-
console.log('============================\n');
|
|
8
|
-
|
|
9
|
-
const selector = new WindowSelector();
|
|
10
|
-
|
|
11
|
-
try {
|
|
12
|
-
console.log('โ
Starting window selection...');
|
|
13
|
-
console.log('๐ฏ Hover over windows to see highlighting (no border)');
|
|
14
|
-
console.log('๐ Window dragging should be blocked');
|
|
15
|
-
console.log('โ Test will auto-stop in 15 seconds\n');
|
|
16
|
-
|
|
17
|
-
await selector.startSelection();
|
|
18
|
-
|
|
19
|
-
// Auto stop after 15 seconds
|
|
20
|
-
setTimeout(async () => {
|
|
21
|
-
console.log('\nโน๏ธ Auto-stopping test...');
|
|
22
|
-
await selector.cleanup();
|
|
23
|
-
process.exit(0);
|
|
24
|
-
}, 15000);
|
|
25
|
-
|
|
26
|
-
} catch (error) {
|
|
27
|
-
console.error('โ Test failed:', error.message);
|
|
28
|
-
await selector.cleanup();
|
|
29
|
-
process.exit(1);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
if (require.main === module) {
|
|
34
|
-
quickTest().catch(console.error);
|
|
35
|
-
}
|