1 | import { clear, cursor } from '@arpel/escape'
|
2 | import { setInterval } from 'timers/promises'
|
3 | import { IO } from '../src/IO.js'
|
4 |
|
5 | process.stdout.write(clear.ENTIRE_SCREEN + cursor.goto(1, 1))
|
6 | console.debug(process.argv)
|
7 | console.debug('>>', '[stdout.isTTY]', process.stdout.isTTY, '[stdin.isRaw]', process.stdin.isRaw)
|
8 | console.debug('>>', 'move/click/drag mouse, or press keys...')
|
9 |
|
10 | const io = IO.build()
|
11 | for await (const startTime of setInterval(1000, Date.now())) {
|
12 | const coord = await io.asyncCursorPos()
|
13 | const now = Date.now()
|
14 | console.debug('>>', 'cursor-position', coord, now - startTime, io.height, io.width, io.size)
|
15 | }
|
16 | io.removeEvents()
|
17 |
|
18 |
|
19 |
|
20 |
|
\ | No newline at end of file |