Skip to content

feat(DemoType): rewrite to match ZoomIt behavior#37

Open
yusufk wants to merge 3 commits into
07JP27:mainfrom
yusufk:feature/demo-type-v2
Open

feat(DemoType): rewrite to match ZoomIt behavior#37
yusufk wants to merge 3 commits into
07JP27:mainfrom
yusufk:feature/demo-type-v2

Conversation

@yusufk

@yusufk yusufk commented May 31, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds DemoType mode (⌃7) — synthesizes keystrokes from a script into the focused application, matching ZoomIt behavior. Supports file input, clipboard ([start] prefix), control keywords ([end], [pause:N], arrow keys), segment navigation, and a dialog fallback for quick use.

Type of Change

  • Feature
  • Bug fix
  • Documentation
  • Tests
  • Refactor / maintenance
  • Build / release / CI

Acceptance Checklist

  • I confirmed feature compatibility with ZoomIt, including operations and settings items. For ZoomacIt-specific features, I discussed the need for the feature with the Owner in Issues.
  • I verified the behavior on my local machine.
  • I wrote user-facing documentation and confirmed that it matches the actual behavior.

Screenshots / Recordings

Settings tab and dialog verified locally. DemoType types into any focused app with natural speed variance.

Related Issues / Notes for Reviewers

  • Verified against microsoft/PowerToys DemoType.cpp
  • Phase 2 (user-driven mode with CGEvent tap) not yet implemented — noted in design doc
  • Design spec: design/DemoType-en.md
  • Docs: docs/usage/demo-type.md + docs/ja/usage/demo-type.md

…ut, control keywords, segments

Rewrites DemoTypeController to align with the actual ZoomIt DemoType implementation
(microsoft/PowerToys src/modules/ZoomIt/ZoomIt/DemoType.cpp):

- Input sources: clipboard ([start] prefix) → file path → dialog fallback
- Control keywords: [end], [pause:N], [enter], [up], [down], [left], [right]
- Segment navigation: [end] pauses, re-trigger hotkey resumes next segment
- Escape to cancel (global event monitor)
- Focus change detection → auto-cancel
- Speed variance (±50% random per character for natural typing feel)
- Settings: file path, speed slider (10-100ms), hotkey (⌃7)
- Design doc: design/DemoType-en.md with full spec and implementation plan

Phase 2 (user-driven mode with CGEvent tap) planned but not yet implemented.
- Add 300ms delay before typing in clipboard/file mode so target app is ready
- Replace NSAlert with NSPanel for input dialog (NSAlert blocks Cmd+V)
- Add Edit menu with Cut/Copy/Paste/SelectAll for modal panel
- Use ModalHelper class for clean modal stop/confirm flow

@07JP27 07JP27 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yusufk The PR description says DemoType includes “Settings: file path, speed slider (10–100ms), hotkey (⌃7)”, but the current settings UI only exposes the DemoType hotkey in the General tab.

demoTypeFilePath, demoTypeSpeed, and demoTypeUserDriven are added to Settings, and DemoTypeController reads demoTypeFilePath / demoTypeSpeed, but there does not appear to be any settings screen or controls where users can configure the script file path, typing speed, or user-driven mode.

As a result, pressing ⌃7 falls back to the input dialog unless the clipboard starts with [start], because the file path remains empty by default.

This also means the PR does not yet satisfy the submission criteria we expect for this feature:

  • Confirm feature compatibility with ZoomIt, including behavior and settings items
  • Verify locally that the implemented behavior and settings work correctly
  • Add user-facing documentation for the feature

Could you please either add the missing DemoType settings UI and documentation, then verify the full flow locally, or update the PR scope/description to clearly state what is implemented in this PR and what remains future work?

- DemoTypeTab: file path picker, speed slider (10-100ms), user-driven toggle
- Added to SettingsView as new tab
- docs/usage/demo-type.md: full usage guide with control keywords, segments
- docs/ja/usage/demo-type.md: Japanese translation

Addresses reviewer feedback: settings UI now exposes all DemoType configuration.
@yusufk

yusufk commented Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

Apologies @07JP27 - updated the settings and readme to include the settings.

@07JP27

07JP27 commented Jun 4, 2026

Copy link
Copy Markdown
Owner

Apologies @07JP27 - updated the settings and readme to include the settings.

Thank you. When it's ready, please re-request a review from me.
image

@yusufk yusufk requested a review from 07JP27 June 6, 2026 12:25
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.

2 participants