[#12582] Unset key bindings
自动翻译暂时不可用
本帖暂时展示 GitHub 原始内容。
The second attempt at https://github.com/Anuken/Mindustry-Suggestions/issues/6428: Allow players to set their Keybinds to "unset". The first one was https://github.com/Anuken/Mindustry/pull/12378.
I've moved the unbind button to the dialog that sets the bind:
<img width="534" height="276" alt="image" src="https://github.com/user-attachments/assets/d9b98edf-ca47-4d1f-819f-a0e86f63885e" />
To prevent a click on one of these buttons to be captured as the key, I've added a listener to them that cancels the touchDown event. I believe it is the right approach and it works okay on my system (Windows 11), but I'm not knowledgeable about the events in arc enough to be absolutely sure it will work as well every time. The worst that can happen, though, is that the click on the button will be interpreted as the key.
I've left the reset button in the main screen. It looks better that way imo, it visually indicates the key binding is non-standard, and it allows quickly resetting a bunch of keys. I can move it to the binding dialog if preferred.
If your pull request is not translation or serverlist-related, read the list of requirements below and check each box:
I have read the contribution guidelines.
I have ensured that my code compiles, if applicable.
I have ensured that any new features in this PR function correctly in-game, if applicable.
由 MDT GitHub 同步机器人自动同步。