[PR #6027] [MERGED] feat(mods): two-axis gameplay mouse scrolling hook #6612

Closed
opened 2026-11-03 06:23:48 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6027
Author: @Xmilon
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: native/mouse-scrolling


📝 Commits (1)

  • 76a6eed feat(mods): two-axis gameplay mouse scrolling event

📊 Changes

4 files changed (+160 additions, -3 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+21 -3)
📝 crates/horizon-client/src/game/native_hooks.rs (+14 -0)
➕ tests/test_mouse_scrolling_hook.py (+112 -0)
➕ tools/native-hook-fragments/mouse_scrolling.json (+13 -0)

📄 Description

🤖 Opened by Xmilon's AI agent (Codex), not by Xmilon personally.

What and why

Fixes #6025; part of #4953. native_mouse_scrolling(scroll, accumulated, buttons, cursor, modifiers, canceled) exposes scaled x/y deltas, integral x/y steps, physical left/middle/right states, GUI cursor position and GLFW modifier bits. It fires after whole steps accumulate and before hotbar or spectator handling. Canceling consumes those accumulated steps and skips gameplay scrolling.

Reuse the existing gameplay/player/no-screen/no-sleep gate. Synthetic input skips the new hook. The legacy vertical native_wheel still runs first and can consume the event; screen-scroll hooks and no-mod behavior are preserved.

Kind

  • feature: something new for players

Vanilla reference

Read pinned26.3 MouseHandler.onScroll bytecode, its ScrollWheelHandler accumulation, screen/player gate and spectator branches. Public contract: InputEvent.MouseScrollingEvent. No game files included.

Other projects' code

None; public event documentation only.

Self-check

Client all-target Clippy -D warnings passed. The actual normalization/gameplay branch compiled with the real mouse module and fake mod: all 12 Rust tests passed, including three new cases for fractional/horizontal/pixel/discrete scrolling, context, cancellation, hotbar/spectator outcomes, legacy precedence and source gates, plus nine existing mouse tests. Four fragment tests, formatting, diff/public-tree checks passed. API fragment only. No game launch/screenshots or full game test suite; CI pending.

🤖 Generated with Codex


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/6027 **Author:** [@Xmilon](https://github.com/Xmilon) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `native/mouse-scrolling` --- ### 📝 Commits (1) - [`76a6eed`](https://github.com/horizon-rust/horizon/commit/76a6eed29cf22006777f243bb4914035a5e6366e) feat(mods): two-axis gameplay mouse scrolling event ### 📊 Changes **4 files changed** (+160 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+21 -3) 📝 `crates/horizon-client/src/game/native_hooks.rs` (+14 -0) ➕ `tests/test_mouse_scrolling_hook.py` (+112 -0) ➕ `tools/native-hook-fragments/mouse_scrolling.json` (+13 -0) </details> ### 📄 Description > 🤖 Opened by Xmilon's AI agent (Codex), not by Xmilon personally. ## What and why Fixes #6025; part of #4953. `native_mouse_scrolling(scroll, accumulated, buttons, cursor, modifiers, canceled)` exposes scaled x/y deltas, integral x/y steps, physical left/middle/right states, GUI cursor position and GLFW modifier bits. It fires after whole steps accumulate and before hotbar or spectator handling. Canceling consumes those accumulated steps and skips gameplay scrolling. Reuse the existing gameplay/player/no-screen/no-sleep gate. Synthetic input skips the new hook. The legacy vertical native_wheel still runs first and can consume the event; screen-scroll hooks and no-mod behavior are preserved. ## Kind - [x] feature: something new for players ## Vanilla reference Read pinned26.3 MouseHandler.onScroll bytecode, its ScrollWheelHandler accumulation, screen/player gate and spectator branches. Public contract: [InputEvent.MouseScrollingEvent](https://aldak0.ru/javadoc/26.3.x/net/neoforged/neoforge/client/event/InputEvent.MouseScrollingEvent.html). No game files included. ## Other projects' code None; public event documentation only. ## Self-check Client all-target Clippy -D warnings passed. The actual normalization/gameplay branch compiled with the real mouse module and fake mod: all 12 Rust tests passed, including three new cases for fractional/horizontal/pixel/discrete scrolling, context, cancellation, hotbar/spectator outcomes, legacy precedence and source gates, plus nine existing mouse tests. Four fragment tests, formatting, diff/public-tree checks passed. API fragment only. No game launch/screenshots or full game test suite; CI pending. 🤖 Generated with [Codex](https://openai.com/codex/) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:23:48 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#6612
No description provided.