[PR #3282] [CLOSED] Key Binds: list the running mods' keys #4889

Closed
opened 2026-11-03 05:08:40 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3282
Author: @wyddy7
Created: 10/28/2026
Status: ❌ Closed

Base: main ← Head: mod-keys-controls


📝 Commits (2)

  • 7d0855f Key Binds lists the running mods' keys
  • 574e6ff Merge main into this branch (options_ui moved to horizon-client-render; native mod keys kept beside the mod key rows)

📊 Changes

5 files changed (+229 additions, -7 deletions)

View changed files

📝 crates/horizon-client-render/src/options_ui.rs (+182 -3)
📝 crates/horizon-client/src/game/mods.rs (+31 -0)
📝 crates/horizon-client/src/game/options.rs (+5 -1)
📝 crates/horizon-mods/src/runtime.rs (+10 -2)
📝 docs/mods.md (+1 -1)

📄 Description

🤖 Opened by wyddy7's AI agent (Claude), not by wyddy7 themselves.

What and why

I'm bringing a movement mod to Horizon (wyddy7/minecraft-spider-man-rust),
and the mod API needs a few handles for mods of that kind; this is the first and smallest, useful to every mod
with keys, not only mine.

A mod's own keys (input.register-key) could only be rebound on its page in Options › Mods. Players look for
keys in Options › Controls › Key Binds, and on Java that is where mod keys are: a mod's key mappings join
options.keyMappings under the mod's category. Key Binds now lists them the same way.

  • After vanilla's mappings, one group per running mod under the mod's name, a row per key it registered.
  • Each row works like a vanilla one: click, press a key or mouse button (Esc unbinds), Reset to the key the mod
    registered; Reset Keys resets them too; the search box finds them.
  • Stored where the mod's page already stores them (horizon-mods.txt) and handed to the mod when the options
    apply, so the mod's page and Key Binds always agree.
  • Nothing changes without a mod that registers keys: vanilla's rows, their order and their key translation are
    untouched.
  • ModKey keeps the key the mod registered (for Reset); docs/mods.md's input row says where keys are rebound.

Vanilla reference

  • KeyBindsList.<init>: every options.keyMappings entry, sorted, with a CategoryEntry before each category
    and a KeyEntry per mapping. A mod's mappings (Fabric's KeyBindingHelper.registerKeyBinding adds them to
    options.keyMappings) show under their own category, which is what this follows.
  • KeyBindsScreen.keyPressed: Escape unbinds the selected mapping.

Self-check

pr_ready (tools/pr_ready.py --quick --base pr-base on MacBook-Air-Daniil, against pr-base at b6c936f82, 4 min 8 s)

Check Result
Scope ✅ 28 files, +239 −7
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 398 passed (24 s)
rustfmt ✅ (3 s)
clippy ✅ (20 s)
tests: horizon-client, horizon-mods ✅ 1334 passed (1 min 49 s)
doc tests ✅ 0 passed (16 s)
content root tests ✅ 5 passed (1 min 3 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅ (1 s)
launcher clippy ✅ (3 s)
launcher tests ✅ 205 passed (10 s)
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

New test options_ui::tests::mod_keys_are_listed_rebound_and_reset_in_key_binds: the mod's group and rows are
listed, a key press binds the row and stores it under the mod, Reset writes the default back. Checked in game: a
mod key rebound R → V in Key Binds, V works in play and R doesn't, Reset brings R back, horizon-mods.txt
follows.

Screenshots

After (no "before": without a mod that registers keys the screen is unchanged). Key Binds scrolled to the end, an example mod's group under vanilla's:

horizon-keybinds-mod-keys

🤖 Generated with Claude Code


🔄 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/3282 **Author:** [@wyddy7](https://github.com/wyddy7) **Created:** 10/28/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `mod-keys-controls` --- ### 📝 Commits (2) - [`7d0855f`](https://github.com/horizon-rust/horizon/commit/7d0855f0178ac2cac68c7c3fbeb0852916ba27dc) Key Binds lists the running mods' keys - [`574e6ff`](https://github.com/horizon-rust/horizon/commit/574e6ffdc7a678a2afbbc286e67dc1fd2174434c) Merge main into this branch (options_ui moved to horizon-client-render; native mod keys kept beside the mod key rows) ### 📊 Changes **5 files changed** (+229 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/options_ui.rs` (+182 -3) 📝 `crates/horizon-client/src/game/mods.rs` (+31 -0) 📝 `crates/horizon-client/src/game/options.rs` (+5 -1) 📝 `crates/horizon-mods/src/runtime.rs` (+10 -2) 📝 `docs/mods.md` (+1 -1) </details> ### 📄 Description > 🤖 Opened by wyddy7's AI agent (Claude), not by wyddy7 themselves. ## What and why I'm bringing a movement mod to Horizon ([wyddy7/minecraft-spider-man-rust](https://github.com/wyddy7/minecraft-spider-man-rust)), and the mod API needs a few handles for mods of that kind; this is the first and smallest, useful to every mod with keys, not only mine. A mod's own keys (`input.register-key`) could only be rebound on its page in Options › Mods. Players look for keys in Options › Controls › Key Binds, and on Java that is where mod keys are: a mod's key mappings join `options.keyMappings` under the mod's category. Key Binds now lists them the same way. - After vanilla's mappings, one group per running mod under the mod's name, a row per key it registered. - Each row works like a vanilla one: click, press a key or mouse button (Esc unbinds), Reset to the key the mod registered; Reset Keys resets them too; the search box finds them. - Stored where the mod's page already stores them (`horizon-mods.txt`) and handed to the mod when the options apply, so the mod's page and Key Binds always agree. - Nothing changes without a mod that registers keys: vanilla's rows, their order and their key translation are untouched. - `ModKey` keeps the key the mod registered (for Reset); docs/mods.md's `input` row says where keys are rebound. ## Vanilla reference - `KeyBindsList.<init>`: every `options.keyMappings` entry, sorted, with a `CategoryEntry` before each category and a `KeyEntry` per mapping. A mod's mappings (Fabric's `KeyBindingHelper.registerKeyBinding` adds them to `options.keyMappings`) show under their own category, which is what this follows. - `KeyBindsScreen.keyPressed`: Escape unbinds the selected mapping. ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base pr-base` on MacBook-Air-Daniil, against pr-base at b6c936f82, 4 min 8 s) | Check | Result | | --- | --- | | Scope | ✅ 28 files, +239 −7 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 398 passed (24 s) | | rustfmt | ✅ (3 s) | | clippy | ✅ (20 s) | | tests: horizon-client, horizon-mods | ✅ 1334 passed (1 min 49 s) | | doc tests | ✅ 0 passed (16 s) | | content root tests | ✅ 5 passed (1 min 3 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ (1 s) | | launcher clippy | ✅ (3 s) | | launcher tests | ✅ 205 passed (10 s) | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | New test `options_ui::tests::mod_keys_are_listed_rebound_and_reset_in_key_binds`: the mod's group and rows are listed, a key press binds the row and stores it under the mod, Reset writes the default back. Checked in game: a mod key rebound R → V in Key Binds, V works in play and R doesn't, Reset brings R back, `horizon-mods.txt` follows. ## Screenshots After (no "before": without a mod that registers keys the screen is unchanged). Key Binds scrolled to the end, an example mod's group under vanilla's: <img width="2560" height="1440" alt="horizon-keybinds-mod-keys" src="https://github.com/user-attachments/assets/4adad0a0-8134-458c-bbc2-afbe07bf40f2" /> 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:08:40 +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#4889
No description provided.