[PR #6272] [CLOSED] Native mods: the crosshair key presses are heard and cancellable #6757

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6272
Author: @MSedgeMC
Created: 11/1/2026
Status: ❌ Closed

Base: main ← Head: feat/md-interaction-key


📝 Commits (2)

  • 19e1ed4 Native mods: the three crosshair key presses are heard and cancellable
  • 4737bb8 Interaction key: a canceled attack lets go of the block being dug

📊 Changes

3 files changed (+89 additions, -8 deletions)

View changed files

📝 crates/horizon-client/src/game/native_hooks.rs (+17 -0)
📝 crates/horizon-client/src/game/remote.rs (+59 -8)
➕ tools/native-hook-fragments/interaction_key.json (+13 -0)

📄 Description

A native mod must hear a press of the attack, use and pick key mappings after
the game decided it acts and before it acts, and be able to cancel it, as
NeoForge's InputEvent.InteractionKeyMappingTriggered reports it.

Horizon ran those three presses in remote_start_attack,
remote_continue_attack, remote_use/remote_use_hands and
RemoteInputWorld::pick with no point for a mod: raw keys and mouse buttons
(native_input_key, native_mouse_button_pre) come before the game decides
what a press means, so a mod had to guess the action from the button and the
bindings.

Proven: cargo test -q -p horizon-client --bin horizon-client interaction_key
on the build VM: the client's binary and its 559 tests compiled and the run
finished 0 failed, 0 passed (the filter names no test; this proves the call
sites compile in the target that owns them).

Not proven: not fired in a running game: no unit test builds the client's
game to press a key in it, so the five call sites are proven to compile, not
to fire or to cancel anything.


🔄 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/6272 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 11/1/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/md-interaction-key` --- ### 📝 Commits (2) - [`19e1ed4`](https://github.com/horizon-rust/horizon/commit/19e1ed46c50fc5963fa2731fa0f2e09e05842e3d) Native mods: the three crosshair key presses are heard and cancellable - [`4737bb8`](https://github.com/horizon-rust/horizon/commit/4737bb8ab035460ab24cae760ab0c04aceab692f) Interaction key: a canceled attack lets go of the block being dug ### 📊 Changes **3 files changed** (+89 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/native_hooks.rs` (+17 -0) 📝 `crates/horizon-client/src/game/remote.rs` (+59 -8) ➕ `tools/native-hook-fragments/interaction_key.json` (+13 -0) </details> ### 📄 Description A native mod must hear a press of the attack, use and pick key mappings after the game decided it acts and before it acts, and be able to cancel it, as NeoForge's `InputEvent.InteractionKeyMappingTriggered` reports it. Horizon ran those three presses in `remote_start_attack`, `remote_continue_attack`, `remote_use`/`remote_use_hands` and `RemoteInputWorld::pick` with no point for a mod: raw keys and mouse buttons (`native_input_key`, `native_mouse_button_pre`) come before the game decides what a press means, so a mod had to guess the action from the button and the bindings. **Proven:** `cargo test -q -p horizon-client --bin horizon-client interaction_key` on the build VM: the client's binary and its 559 tests compiled and the run finished 0 failed, 0 passed (the filter names no test; this proves the call sites compile in the target that owns them). **Not proven:** not fired in a running game: no unit test builds the client's game to press a key in it, so the five call sites are proven to compile, not to fire or to cancel anything. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:26:12 +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#6757
No description provided.