[PR #5424] [MERGED] Pick block bound to a key clones the hovered slot in container screens #6280

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5424
Author: @Blzs2005
Created: 10/31/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @ludovic111

Base: main ← Head: fix/pick-key-in-inventory


📝 Commits (2)

  • a16ba2f Pick block bound to a key clones the hovered slot in container screens
  • 932dfb1 Merge remote-tracking branch 'origin/main' into fix/pick-key-in-inventory

📊 Changes

1 file changed (+50 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+50 -0)

📄 Description

🤖 Opened by Blzs2005's AI agent (Claude Code, Claude Opus 5.5), not by Blzs2005 personally.

Fixes #5378.

Pick block bound to a keyboard key (X here) did nothing in the creative inventory. A key bound to a mouse mapping becomes that button through keyboard_button, which only lets it through while gameplay has the keyboard: behind a screen the key was dropped. Vanilla's AbstractContainerScreen.keyPressed handles it there: keyPickItem.matches clicks the hovered slot with CLONE (button 0).

  • Behind a screen, a press or repeat of the key bound to key.pickItem (container_key_clones) now runs inventory_pick_key: menu_click(slot, 0, Input::Clone) on the hovered slot. The menu engine and creative::click_display already do vanilla's checks (infinite materials, empty hand, a stack in the slot).
  • In the inventory and container screens and the creative item tabs; not on the search tab, whose box takes the key, nor behind a server dialog. Keys bound to attack and use still do nothing behind a screen, as in vanilla.
  • The middle button's own path (press, release and the type 2 quick craft drag) is unchanged.

Checked by hand on Windows: with pick block on X, X over an item in a creative item tab and in the Survival Inventory tab picks up a full stack.

pr_ready (tools/pr_ready.py --quick on Blzs, against origin/main at dfd94a7e5, 4 min 59 s)

Check Result
Scope ✅ 2 files, +51 −1 (1 of them a local-only patch, see below)
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 505 passed (1 min 51 s)
rustfmt ✅ (17 s)
clippy ❌ failed (5 s)
tests: horizon-client, horizon-threads ❌ 1419 passed, 1 failed (2 min 35 s)
doc tests ✅ 0 passed (6 s)
content root tests ➖ content root untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses

Both ❌ come from main on Windows, not from this change:

  • main's horizon-threads doesn't build on Windows (boot_paint.rs needs the Win32_Graphics_Gdi and Win32_UI_WindowsAndMessaging features of windows-sys; #5299 turns them on). The run had them turned on locally (the second file in Scope, not in this PR), and clippy then stops on a needless &mut lint in that same crate. cargo clippy -p horizon-client --lib --bins --no-deps -- -D warnings passes.
  • native_hooks::tests::property_setters_refuse_no_change searches its own source for \n-joined text, which a core.autocrlf checkout has as \r\n. The file is untouched here.

The new a_key_bound_to_pick_block_clones_behind_a_container_screen test passes, with a_held_key_bound_to_a_button_repeats_its_clicks and a_dialog_releases_held_keys_like_a_screen.

🤖 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/5424 **Author:** [@Blzs2005](https://github.com/Blzs2005) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/pick-key-in-inventory` --- ### 📝 Commits (2) - [`a16ba2f`](https://github.com/horizon-rust/horizon/commit/a16ba2fb5d52713fb3eaaaaa98e7306b410dbb4a) Pick block bound to a key clones the hovered slot in container screens - [`932dfb1`](https://github.com/horizon-rust/horizon/commit/932dfb1ec2e4fa04bcd519283db4570fb00cd9c7) Merge remote-tracking branch 'origin/main' into fix/pick-key-in-inventory ### 📊 Changes **1 file changed** (+50 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+50 -0) </details> ### 📄 Description > 🤖 Opened by Blzs2005's AI agent (Claude Code, Claude Opus 5.5), not by Blzs2005 personally. Fixes #5378. Pick block bound to a keyboard key (X here) did nothing in the creative inventory. A key bound to a mouse mapping becomes that button through `keyboard_button`, which only lets it through while gameplay has the keyboard: behind a screen the key was dropped. Vanilla's `AbstractContainerScreen.keyPressed` handles it there: `keyPickItem.matches` clicks the hovered slot with `CLONE` (button 0). - Behind a screen, a press or repeat of the key bound to key.pickItem (`container_key_clones`) now runs `inventory_pick_key`: `menu_click(slot, 0, Input::Clone)` on the hovered slot. The menu engine and `creative::click_display` already do vanilla's checks (infinite materials, empty hand, a stack in the slot). - In the inventory and container screens and the creative item tabs; not on the search tab, whose box takes the key, nor behind a server dialog. Keys bound to attack and use still do nothing behind a screen, as in vanilla. - The middle button's own path (press, release and the type 2 quick craft drag) is unchanged. Checked by hand on Windows: with pick block on X, X over an item in a creative item tab and in the Survival Inventory tab picks up a full stack. **pr_ready** (`tools/pr_ready.py --quick` on Blzs, against origin/main at dfd94a7e5, 4 min 59 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +51 −1 (1 of them a local-only patch, see below) | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 505 passed (1 min 51 s) | | rustfmt | ✅ (17 s) | | clippy | ❌ failed (5 s) | | tests: horizon-client, horizon-threads | ❌ 1419 passed, 1 failed (2 min 35 s) | | doc tests | ✅ 0 passed (6 s) | | content root tests | ➖ content root untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | Both ❌ come from main on Windows, not from this change: - main's `horizon-threads` doesn't build on Windows (`boot_paint.rs` needs the `Win32_Graphics_Gdi` and `Win32_UI_WindowsAndMessaging` features of windows-sys; #5299 turns them on). The run had them turned on locally (the second file in Scope, not in this PR), and clippy then stops on a `needless &mut` lint in that same crate. `cargo clippy -p horizon-client --lib --bins --no-deps -- -D warnings` passes. - `native_hooks::tests::property_setters_refuse_no_change` searches its own source for `\n`-joined text, which a `core.autocrlf` checkout has as `\r\n`. The file is untouched here. The new `a_key_bound_to_pick_block_clones_behind_a_container_screen` test passes, with `a_held_key_bound_to_a_button_repeats_its_clicks` and `a_dialog_releases_held_keys_like_a_screen`. 🤖 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 06:17:38 +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#6280
No description provided.