Commit Graph
16 Commits
Author SHA1 Message Date
bea 77497fd9f7 clean up on cmd-q and forced exits 2026-10-01 23:10:41 +02:00
bea 1b01320c1d register the native hook only once 2026-10-01 22:48:15 +02:00
bea ca99bc0533 let the permissions dialog retry the hook 2026-09-29 12:15:47 +02:00
bea 93a64ca1f3 ask for permissions instead of exiting when the hook fails 2026-09-29 12:10:42 +02:00
bea f1b4e65998 use system look and feel 2026-09-29 12:02:53 +02:00
bea e551d24bff fix scheduling, threading and movement bugs
scheduling:
- cursor mover created a new java.util.timer for every movement and never
  cancelled it, leaking a live thread roughly every 10 seconds; timers are
  replaced by a single shared scheduledexecutorservice with daemon threads,
  shut down when the automation stops.

clicks:
- the double click sequence used thread.sleep() inside a timer task, blocking
  the scheduler thread; it is now scheduled as one-shot actions on the shared
  scheduler, with the same pacing as before.
- stopping the automation now also cancels in-flight movements and pending
  clicks, instead of letting them run to completion.

movement math:
- when the destination shared one coordinate with the starting position, the
  step on the other axis was computed as length/0 = infinity, and the stop
  condition checked one axis with || instead of &&, so a movement could stop
  (and click) before reaching its destination. steps are now guarded and the
  movement stops only when both axes have converged.

ui and lifecycle:
- the app could not be closed: closing the window only hid it, and ESC
  unregistered the hotkey without exiting. the window now exits cleanly on
  close, stopping the automation and unregistering the native hook.
- toggleRunning() was called from the jnativehook thread and touched swing
  components off the EDT; UI updates are now marshalled to the EDT.
- the hotkey thrashed: key repeats re-fired the toggle while ctrl+alt was
  held, and any other key pressed with the combo held toggled it too. it now
  fires exactly once, when the combo is completed.

away-detection (CursorMoveListener) stays intentionally unscheduled: it cannot
tell the user's movements apart from the app's own, and will be reworked in a
future iteration.
2026-09-29 11:51:06 +02:00
bea 8ef9ea9288 Add timestamp screenshot for MacOS on debugging UI
continuous-integration/drone/push Build is passing
2024-08-05 23:52:13 +02:00
bea c3c1b99f1b Improve code quality
continuous-integration/drone/push Build is failing
2024-08-05 21:36:44 +02:00
bea 9ad074bb51 Optimize imports
continuous-integration/drone/push Build is passing
2024-08-05 21:30:08 +02:00
bea a6c43fd646 Improve button and keystrokes handling
continuous-integration/drone/push Build is passing
2024-08-05 21:29:02 +02:00
bea 48f12a1640 Fix clicking on clock every X times 2024-08-05 20:50:03 +02:00
bea b038098c3c Refactor packages and add GUI with start button
continuous-integration/drone/push Build is passing
2024-08-05 20:39:14 +02:00
bea 9c0b3290f7 Use SecureRandom
continuous-integration/drone/push Build is passing
2024-08-05 19:28:35 +02:00
bea 7567552c1a Do not use infinite loop
continuous-integration/drone/push Build is passing
2024-08-05 19:24:00 +02:00
bea 46265e99b1 Improve linting
continuous-integration/drone/push Build is passing
2024-08-05 19:18:44 +02:00
bea e4d429a88f start 2024-08-05 18:51:10 +02:00