[PR #641] [MERGED] Honor mouse-bound hotbar swaps in inventories #2690

Closed
opened 2026-11-02 15:58:16 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/641
Author: @Online5277
Created: 10/17/2026
Status: ✅ Merged
Merged: 10/17/2026
Merged by: @ludovic111

Base: main ← Head: fix/container-mouse-hotkeys


📝 Commits (2)

  • d98ee9a Route mouse-bound hotbar keys through container swaps
  • 103d44f Merge main into fix/container-mouse-hotkeys

📊 Changes

2 files changed (+61 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+12 -0)
📝 crates/horizon-client/src/keybinds.rs (+49 -0)

📄 Description

Mouse buttons bound to hotbar slots now swap the hovered inventory item into the selected slot instead of acting as a pickup click. The same routing supports mouse-bound off-hand swaps in survival and Creative containers.

Check the container's slot bindings before ordinary mouse handling, reuse the existing keyboard swap/menu path, and consume both the press and release. Like the pinned client's checkHotbarMouseClicked, require an empty carried stack for the action, prioritize the off hand over hotbar conflicts, and retain primary-button and Creative pick-item precedence.

Fixes #619.

Validation: all three key-binding tests passed, including all nine hotbar mappings on middle/side buttons, off-hand priority, primary-button precedence and Creative pick-item precedence. Client all-target Clippy with warnings denied, formatting and diff checks passed.

Draft for in-game testing: bind hotbar slots 1 and 2 to mouse buttons 4 and 5, hover items in survival inventory, a chest, and Creative inventory/item tabs, and check each swaps once on press with no pickup on release. Repeat with a carried stack and a mouse-bound off-hand swap. No client was launched; actual menu interaction and multiplayer synchronization remain manual checks.


🔄 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/641 **Author:** [@Online5277](https://github.com/Online5277) **Created:** 10/17/2026 **Status:** ✅ Merged **Merged:** 10/17/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/container-mouse-hotkeys` --- ### 📝 Commits (2) - [`d98ee9a`](https://github.com/horizon-rust/horizon/commit/d98ee9a7603f9220239cbcb059664311e12526c3) Route mouse-bound hotbar keys through container swaps - [`103d44f`](https://github.com/horizon-rust/horizon/commit/103d44f72f7cfc9e60ccba646f58da2ecb4241f7) Merge main into fix/container-mouse-hotkeys ### 📊 Changes **2 files changed** (+61 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+12 -0) 📝 `crates/horizon-client/src/keybinds.rs` (+49 -0) </details> ### 📄 Description Mouse buttons bound to hotbar slots now swap the hovered inventory item into the selected slot instead of acting as a pickup click. The same routing supports mouse-bound off-hand swaps in survival and Creative containers. Check the container's slot bindings before ordinary mouse handling, reuse the existing keyboard swap/menu path, and consume both the press and release. Like the pinned client's checkHotbarMouseClicked, require an empty carried stack for the action, prioritize the off hand over hotbar conflicts, and retain primary-button and Creative pick-item precedence. Fixes #619. Validation: all three key-binding tests passed, including all nine hotbar mappings on middle/side buttons, off-hand priority, primary-button precedence and Creative pick-item precedence. Client all-target Clippy with warnings denied, formatting and diff checks passed. Draft for in-game testing: bind hotbar slots 1 and 2 to mouse buttons 4 and 5, hover items in survival inventory, a chest, and Creative inventory/item tabs, and check each swaps once on press with no pickup on release. Repeat with a carried stack and a mouse-bound off-hand swap. No client was launched; actual menu interaction and multiplayer synchronization remain manual checks. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 15:58:16 +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#2690
No description provided.