injecting-mouse-and-keyboard
CommunityDrive desktop-style shortcuts in Compose tests
Software Engineering#jetpack-compose#ui-testing#hover#keyboard-shortcuts#performmouseinput#performkeyinput#adb-e2e
Authorskydoves
Version1.0.0
Installs0
System Documentation
What problem does it solve?
It solves the problem of reliably testing Jetpack Compose UIs that react to non-touch input such as right-clicks, hover, mouse wheel scrolling, and keyboard shortcuts (including modifier keys and key autorepeat) without flaky or platform-specific workarounds.
Core Features & Use Cases
- Mouse input injection: performMouseInput supports click/rightClick/doubleClick/tripleClick/longClick, animated movement, hover enter/exit, smoothScroll, and drag-and-drop using node-local coordinates.
- Keyboard input injection: performKeyInput enables keyDown/keyUp, pressKey, modifier-state assertions (Ctrl/Shift/Alt/Meta/Fn and Caps/Num/Scroll lock toggles), and repeat-key behavior via injection event time.
- Multi-modal coordination: performMultiModalInput combines mouse and key flows (e.g., hover-then-click while holding Shift) in one batched step so state persists across sub-scopes.
Quick Start
Ask the AI to “right-click on a Compose node, assert the context menu appears, then trigger a Ctrl+S shortcut using performKeyInput.”
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: injecting-mouse-and-keyboard Download link: https://github.com/skydoves/android-testing-skills/archive/main.zip#injecting-mouse-and-keyboard Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.