node-mac-recorder
Version:
Native macOS screen recording package for Node.js applications
38 lines (28 loc) ⢠1.07 kB
JavaScript
const WindowSelector = require('./window-selector');
async function simpleTest() {
const selector = new WindowSelector();
console.log('š Starting simple window selector test...');
console.log('Move your cursor around - you should see overlay highlighting windows');
console.log('Press Ctrl+C to exit\n');
try {
selector.on('windowEntered', (window) => {
console.log(`ā”ļø Entered: ${window.appName} - "${window.title}"`);
});
selector.on('windowLeft', (window) => {
console.log(`ā¬
ļø Left: ${window.appName} - "${window.title}"`);
});
await selector.startSelection();
// Keep running until Ctrl+C
process.on('SIGINT', async () => {
console.log('\nš Stopping...');
await selector.cleanup();
process.exit(0);
});
// Prevent the process from exiting
setInterval(() => {}, 1000);
} catch (error) {
console.error('ā Error:', error);
}
}
simpleTest();