Sign in Get 3 free credits

Try a job or a niche: tiktok captions, study notes, excel formulas. Press Esc to close.

Compose mouse input tests

Writes Jetpack Compose tests that drive mouse and keyboard input, so clicks, drags and shortcuts are covered.

Claude's review

7/10 Precise Compose mouse and keyboard test injection guidance with wrong versus right patterns.

We asked Claude the question you would ask: would I be glad I installed this? Two separate reviews, the second blind to the first, must both rate a skill 7 or higher before we sell it.

In detail

Use this skill to drive Jetpack Compose UI from tests with non-touch input — performMouseInput (click, rightClick, doubleClick, tripleClick, longClick, animateMoveTo, dragAndDrop, smoothScroll, enter / exit, press / release / scroll), performKeyInput (keyDown, keyUp, isKeyDown, modifier-state vals isCtrlDown / isShiftDown / isAltDown / isMetaDown / isFnDown / isCapsLockOn / isNumLockOn / isScrollLockOn, helpers pressKey, withKeyDown, withKeysDown, withKeyToggled, withKeysToggled), performKeyPress for direct KeyEvent injection, and performMultiModalInput for hover-then-click flows. Covers MouseButton (Primary, Secondary, Tertiary), ScrollWheel (Horizontal, Vertical), and the repeat-key behaviour driven by advanceEventTime. Use when the developer asks "how do I right-click in a Compose test", "test a Ctrl+S shortcut", "send a keyboard shortcut", "simulate hover", "test a tooltip", "scroll the mouse wheel", or "drag and drop with a mouse" on desktop or Compose Multiplatform.

How you use it

  1. Add it to your pack, then download your pack (1 credit).
  2. In Claude, open Customize > Skills and upload the zip. Code execution needs to be on under Settings > Capabilities.
  3. Ask Claude for the job in your own words. It uses the skill when your request matches what it does. Step by step guide

Safety check

Nothing risky found: no hidden instructions, no download and run, no reading of saved passwords or keys.

An automated scan lowers risk but cannot promise zero risk. How we check skills

Preview

The first lines of SKILL.md
---
name: injecting-mouse-and-keyboard
description: Use this skill to drive Jetpack Compose UI from tests with non-touch input — performMouseInput (click, rightClick, doubleClick, tripleClick, longClick, animateMoveTo, dragAndDrop, smoothScroll, enter / exit, press / release / scroll), performKeyInput (keyDown, keyUp, isKeyDown, modifier-state vals isCtrlDown / isShiftDown / isAltDown / isMetaDown / isFnDown / isCapsLockOn / isNumLockOn / isScrollLockOn, helpers pressKey, withKeyDown, withKeysDown, withKeyToggled, withKeysToggled), performKeyPress for direct KeyEvent injection, and performMultiModalInput for hover-then-click flows. Covers MouseButton (Primary, Secondary, Tertiary), ScrollWheel (Horizontal, Vertical), and the repeat-key behaviour driven by advanceEventTime. Use when the developer asks "how do I right-click in a Compose test", "test a Ctrl+S shortcut", "send a keyboard shortcut", "simulate hover", "test a tooltip", "scroll the mouse wheel", or "drag and drop with a mouse" on desktop or Compose Multiplatform.
license: Apache-2.0. See LICENSE for complete terms.
metadata:
  author: Jaewoong Eum (skydoves)
  keywords:
  - jetpack-compose
  - ui-testing
  - performMouseInput
  - performKeyInput
  - performMultiModalInput
  - mouse-button
  - scroll-wheel
  - keyboard-shortcut
  - hover
  - compose-multiplatform
---

# Injecting Mouse and Keyboard — performMouseInput, performKeyInput, performMultiModalInput

Mouse and keyboard input are first-class modalities in Compose tests. Each has its own injection scope and entry point, plus a shared `performMultiModalInput` that combines all of them inside one batched gesture (touch, mouse, key, rotary, trackpad, indirect pointer). Coordinates remain node-local — the same rules as touch — and the entire injection state survives across `perform.*Input` blocks on the same node.

## When to use this skill

- The test exercises a desktop or Compose Multiplatform UI that responds to clicks, hover, right-click, scroll wheel, or modifier keys.
- The test must drive a keyboard shortcut (e.g. `Ctrl+S`, `Shift+Tab`, arrow-key navigation).
- The test must verify hover-only behaviour: tooltip pop, color change on `Modifier.hoverable`, mouse-only ripple state.
- The test simulates a drag-and-drop with a mouse pointer.
- The test must combine modalities — for example "hover at (x, y) then click and hold while pressing `Shift`".

## When NOT to use this skill

- The interaction is a finger tap or drag — use `../injecting-touch-gestures/SKILL.md`. Mouse is not interchangeable with touch on Android device tests.
- A simple `performClick()` already routes through the right modality per platform — use `../clicking-and-scrolling/SKILL.md`.
- The test types into a `TextField` — use `../entering-text/SKILL.md`. Key input here is for shortcuts, not text entry.
- The test waits for a hover-driven animation to settle — pause the clock first per `../../synchronization/testing-animations-deterministically/SKILL.md`.

## Prerequisites

...

From skydoves's repository, Apache-2.0 licence.

Related skills

  • Checked

    Android Gradle Plugin upgrade

    Moves Kotlin Multiplatform projects to Android Gradle Plugin 9 and fixes the build failures it causes.

    by Kotlin 1.1k
    8/101 credit
  • Checked

    CocoaPods to SwiftPM

    Moves Kotlin Multiplatform projects from CocoaPods to Swift Package Manager and updates the Xcode project.

    by Kotlin 1.1k
    8/101 credit
  • Checked

    Kotlin Native build speed

    Diagnoses and fixes slow Kotlin/Native iOS builds in Kotlin Multiplatform projects, both locally and on CI.

    by Kotlin 1.1k
    7/101 credit
  • Checked

    SwiftUI Liquid Glass

    Adds and reviews Liquid Glass in SwiftUI apps for iOS 26, avoiding pitfalls with bars, buttons and scrolling.

    by FloWritesCode 476
    7/101 credit
  • Checked

    Native Mobile App Design

    Designs Expo and React Native screens that feel truly native, with proper navigation, motion and dark mode.

    by Appllama 5.7k
    7/101 credit
  • Checked

    Offline Android LLM apps

    Builds an Android app that runs an open LLM on the phone with LiteRT, so it works without a server.

    by android 11k
    7/101 credit

Secure checkout

Credits

AUD

  1. 1Choose
  2. 2Pay on Square
  3. 3Credits added