Index of every page on this site: llms.txt
All skills
oahc09 avatar

/cocosair-input-action

@ed38648
by oahc09oahc09/cocosairjs3 stars
2
Run it yourself

Wire keyboard, mouse, touch and action state; navigate SceneStack pages. Use for focus, held-key resets, session gates, DOM canvas errors or persistent push/pop.

  • 10 files
  • 38.8 KB
  • MIT
  • Updated last month
  • GitHub
Use this Skill: https://skilld.dev/gh/oahc09/cocosairjs/cocosair-input-action

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencestriggers.md

≈274 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Cocos AIR native input and the action layer triggers

Source annotations refer to the AIR checkout.

When to use what

  • "React to a touch, key or mouse directly" -> input.on(Input.EventType.X, handler) for the unified feed and systemEvent.on(SystemEvent.EventType.X, handler) for the raw feed (src/cocos/input/input.ts:160, src/cocos/input/system-event.ts:72); the event classes are EventTouch/EventKeyboard/EventMouse, keys come from KeyCode.
  • "Map held keys/pointers to named game actions" -> createActionState (pure reducer) plus createActionInput (one backend); query with held/pressed/released/axis and drain edges with consumeTick (src/air/action-state.ts:124-172).
  • "Gate a paused or backgrounded app" -> createSessionGate and its active/generation; pass it as the adapter's session (src/air/action-input.ts:69-100).
  • "Persistent-page push/pop with preserved state" -> SceneStack over one long-lived Scene (src/air/scene-stack.ts:47-188); use app.run() replacement instead for a full scene swap (owned by the application skill).

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at ed38648. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated last month
layer
subsystem
All 1 allowed tools
Read Edit Write Bash
Other metadata
compatibility
Cocos AIR source checkout or installed cocosair.js package. Browser rendering requires WebGL 2; source tooling requires Node.js >=18. Use the host-provided tools and user-authorized workspace.
when_to_use
[
  "map keys, touch or mouse to named actions",
  "keys stop firing while an input has focus",
  "DOM input fails without an explicit canvas",
  "clear held actions after blur or page hiding",
  "preserve page state across push/pop transitions"
]
owns
[
  "native-input",
  "action-state",
  "dom-input",
  "focus-reset",
  "session-gate",
  "scene-stack"
]
not_for
[
  "full scene replacement -> cocosair-application",
  "DOM overlay geometry -> cocosair-graphics-and-dom",
  "node lifecycle and custom events -> cocosair-scene-graph"
]
metadata
{
  "author": "oahc09@gmail.com",
  "version": "1.0.0",
  "last-updated": "2026-10-13",
  "description_zh": "处理原生和 DOM 输入、动作状态、焦点、会话门禁及 SceneStack。用于按键触摸、动作映射、输入阻断或清理问题。"
}

README badge

README badge for oahc09/cocosairjs/cocosair-input-action