Skip to content

Add Advanced Input Detection extension by MarkSkecher#2402

Closed
XOX-zip wants to merge 3 commits intoTurboWarp:masterfrom
XOX-zip:master
Closed

Add Advanced Input Detection extension by MarkSkecher#2402
XOX-zip wants to merge 3 commits intoTurboWarp:masterfrom
XOX-zip:master

Conversation

@XOX-zip
Copy link
Copy Markdown

@XOX-zip XOX-zip commented Jan 30, 2026

Extension Information

  • Name: Advanced Input Detection (高级输入检测)
  • ID: markskecherinput
  • Author: MarkSkecher
  • License: MIT

Description

This extension provides advanced input detection capabilities for Scratch projects, including:

  • Mouse wheel scroll detection (up/down direction and scroll amount)
  • Mouse button detection (left, middle, right buttons)
  • Double-click detection and click counting
  • Mouse position tracking (X/Y coordinates)
  • Advanced keyboard input detection
  • Key combination detection (modifier keys + regular keys)
  • Key press counting and tracking
  • Message receiving and handling

Features

  • Mouse Input: Wheel scrolling, button states, double-click, position tracking
  • Keyboard Input: Individual keys, key combinations, modifier keys, arrow keys, number/letter key detection
  • Event Handling: Message receiving, click/key press counting
  • Utility Functions: Reset counters, clear messages

Testing

  • Extension loads without errors
  • All blocks function as expected
  • No console errors or warnings
  • Compatible with TurboWarp runtime

Additional Notes

This extension enhances the default Scratch input capabilities by providing more detailed and flexible input detection options for advanced projects.

@github-actions github-actions bot added the pr: new extension Pull requests that add a new extension label Jan 30, 2026
@Brackets-Coder
Copy link
Copy Markdown
Contributor

Try not to close and re-open a PR repeatedly
Also, a large portion of this extension's functionality can be done with existing extensions

@@ -0,0 +1,556 @@
// Name: Advanced Input
// ID: markskecherinput
// Description: 高级输入检测扩展,支持鼠标滚轮、鼠标按键、键盘组合键和输入事件检测.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Description must be in english

Comment on lines +353 to +362
"空格键",
"回车键",
"退格键",
"删除键",
"制表键",
"逃逸键",
"上箭头",
"下箭头",
"左箭头",
"右箭头",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These keys must be in English

Comment on lines +423 to +433
this.wheelDirection === (args.DIRECTION === "向上" ? "up" : "down")
);
}

getWheelDelta() {
return this.wheelDelta;
}

mouseButtonPressed(args) {
const buttonMap = { 左: "left", 中: "middle", 右: "right" };
return this.mouseButtons[buttonMap[args.BUTTON]] || false;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All user-facing names must be in English

They'll get translated by Scratch or the browser later

@XOX-zip XOX-zip closed this Apr 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr: new extension Pull requests that add a new extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants