Skip to content

Feat/capture backends#3

Open
PekingSpades wants to merge 38 commits into
mainfrom
feat/capture-backends
Open

Feat/capture backends#3
PekingSpades wants to merge 38 commits into
mainfrom
feat/capture-backends

Conversation

@PekingSpades
Copy link
Copy Markdown
Owner

No description provided.

- add cross-platform keyboard/mouse/display/screenshot implementations and CGO headers
- add examples and deskact-tester command
- add Go module and GitHub Actions build workflows
- split display/screenshot packages and move display defaults
- move keyboard code into a `keyboard` package with key catalogs, aliases, and errors; re-export APIs
- add mouse package with typed buttons/scroll units and platform mappings
- return errors from display mouse ops and update tester; extend native backends for scroll units/buttons
Provide !windows no-op IsDPIAware/InitDPIAwareness so examples compile off Windows.
- prompt for DPI init and log the choice in capture/display examples
- add interactive mouse example with scroll/move/click actions and ms delay
- build and upload mouse example artifacts in CI
- prompt for DPI awareness init
- add display selection, drag action, and per-display move
- show display info plus ASCII layout at location
- add helpers for input ranges and coordinate mapping
- post per-click down/up events with incremented click state
- add small delays between clicks for double/triple detection
- handle null event source early
- add smooth drag path for darwin
- route drag operations through platform hooks
- remove unused dragMouse stubs on windows/x11
- reuse DragTo for display-level drags
- convert to absolute coords for DragSmooth
- add cross-platform key state reader with press/toggle enums
- expose keyboardstate helpers from the root package
- remove alias constants and alias lookup in key handling
- expose SupportedKeyNames to filter keys by platform support
- implement window enumeration for Windows and macOS with platform metadata
- compute per-display window regions with DPI-aware physical mapping
- add window overlay example for capture/annotation
- use Windows logical display size from monitor info when available
- add apps package with AppInfo, desktop/installed listing, and platform-specific icon extraction
- expose AppInfo and app listing helpers from core package
- add apps example to list apps, save icons, and generate Markdown/PDF summaries
- build new apps/window examples in CI and ignore output artifacts
- allow GitHub artifact uploads to fail without breaking CI
- upload build artifacts to the server for examples and tester builds
- set artifact retention to 7 days
- fall back to MSI ProductIcon/InstallLocation when uninstall metadata is empty
- include per-app name/path/icon status in output logs
- emit surrogate pairs for code points above U+FFFF on Windows
- pass 1-2 UTF-16 code units to CGEvent Unicode input on macOS
- switch alias resolution to NSURL APIs with autorelease pool
- match IOHIDSystem service by class name string to avoid header dependency
- cast window layer to int32 for platform info struct
- add keyboard state display, key list, and delayed key tap
- build keyboard example in CI artifacts
Add electronId to Display that matches the id returned by Electron's
screen.getAllDisplays(), enabling direct ID interop between DeskAct
and Electron apps.

Platform implementations:
- Windows: QueryDisplayConfig + SuperFastHash of adapter/target info
- macOS: CGDirectDisplayID cast (already Electron-compatible)
- Linux: XRandR EDID parsing (manufacturer_id, display_name hash, output_id)

Also add an Electron example app (examples/display/electron/) with GUI
window for verifying ID match, and a CI workflow to build it for
win-x64 and mac-arm64.
electron-builder uses dist/win-unpacked/ on Windows but
dist/mac-arm64/ on macOS (no -unpacked suffix). Update the
compress step glob to match both patterns.
The new XRandR-based electron ID computation requires Xrandr.h,
which is provided by libxrandr-dev on Ubuntu.
…putation

Replace the C SuperFastHash implementation with an equivalent Go port.
C headers now pass raw data (hash input strings, EDID fields) to Go,
which computes the Electron display ID entirely in Go code.

- Add display/superfasthash.go (Go port of Paul Hsieh's SuperFastHash)
- Remove display/superfasthash.h (C implementation no longer needed)
- Windows: C passes raw adapter/target string, Go hashes it
- macOS: use CGDirectDisplayID handle directly (no hash needed)
- Linux: C passes raw EDID fields, Go computes hash and display ID
The Drag/DragSmooth functions previously relied on C-level location()
to determine the drag start point. On macOS, CGEventPost is async so
location() could return stale positions, causing incorrect drag origins.

Changes:
- Drag/DragSmooth signatures now take (fromX, fromY, toX, toY) explicitly
- C smoothlyMoveMouse/smoothlyDragMouse accept startPoint parameter
  instead of calling location() internally
- MoveSmooth calls Location() in Go and passes it to C as startPoint
- macOS moveMouse/dragMouse poll waitForCursorSync after CGEventPost
  to ensure position is updated before subsequent operations
- Display.Drag/DragTo unified across platforms into display.go
clang on macOS 15 rejects implicit function declarations under C99.
waitForCursorSync() called location() before its definition, causing
a compile error on darwin/arm64.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant