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.
Files changed (41) hide show
  1. package/.claude/settings.local.json +1 -1
  2. package/CLAUDE.md +51 -3
  3. package/package.json +1 -1
  4. package/src/avfoundation_recorder.mm +85 -55
  5. package/src/mac_recorder.mm +49 -57
  6. package/bring-to-front-test.js +0 -159
  7. package/capture-test.js +0 -87
  8. package/cursor-test.js +0 -22
  9. package/debug-test.js +0 -95
  10. package/default-auto-front-test.js +0 -86
  11. package/final-multi-display-test.js +0 -74
  12. package/list-test.js +0 -46
  13. package/quick-cursor-test.js +0 -20
  14. package/quick-screen-test.js +0 -34
  15. package/quick-test.js +0 -35
  16. package/system-sound-test.js +0 -46
  17. package/test-audio-controls.js +0 -104
  18. package/test-both.js +0 -46
  19. package/test-console-logs.js +0 -81
  20. package/test-coordinate-debug.js +0 -25
  21. package/test-cursor-visible.js +0 -41
  22. package/test-electron-detection.js +0 -44
  23. package/test-final-coordinate-fix.js +0 -38
  24. package/test-hybrid.js +0 -53
  25. package/test-macos14-forced.js +0 -107
  26. package/test-macos14.js +0 -56
  27. package/test-multi-display-overlay.js +0 -185
  28. package/test-multi-screen-selection.js +0 -171
  29. package/test-multidisplay-fix.js +0 -120
  30. package/test-native-cursor.js +0 -31
  31. package/test-overlay-tracking.js +0 -175
  32. package/test-primary-live.js +0 -17
  33. package/test-primary-window-debug.js +0 -33
  34. package/test-quick.js +0 -55
  35. package/test-real-screen-ids.js +0 -32
  36. package/test-screencapture-only.js +0 -50
  37. package/test-screencapture-pure.js +0 -69
  38. package/test-screencapture.js +0 -52
  39. package/test-system-audio.js +0 -104
  40. package/test-window-selector-fix.js +0 -88
  41. package/window-selector-test.js +0 -160
@@ -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);
@@ -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
- }
@@ -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
- }