Repository navigation
Migrate existing keycode-based keybindings - #16049
Conversation
appgurueu
left a comment
There was a problem hiding this comment.
The dialog seems to work if you have non-default keybindings set 👍
Shouldn't we however apply a list of keycode defaults first? e.g. for me zoom changes from Z to Y due to the new default being a scancode rather than a keycode, but I won't be shown this dialog.
There was a problem hiding this comment.
EDIT:
Shouldn't we however apply a list of keycode defaults first?
That's a good point, however keys that used to be set to the default are not saved in minetest.conf, thus it might be rather cumbersome to find that out.
- The dialog looks good. The link (now) does have a good contrast.
- No issues found using the Linux Irrlicht device (no dialog shown by default)
Output of print(value, normalized):
KEY_END KEY_END
KEY_F4 KEY_F4
KEY_KEY_G KEY_KEY_G
KEY_PRIOR KEY_PRIOR
KEY_F7 KEY_F7
KEY_KEY_P KEY_KEY_P
KEY_PERIOD KEY_PERIOD
KEY_KEY_F KEY_KEY_F
KEY_KEY_C KEY_KEY_C
KEY_NEXT KEY_NEXT
KEY_F9 KEY_F9
KEY_ADD KEY_ADD
KEY_HOME KEY_HOME
KEY_KEY_R KEY_KEY_R
KEY_F8 KEY_F8
KEY_SUBTRACT KEY_SUBTRACT
I was thinking we could simply take the defaults from https://github.com/luanti-org/luanti/pull/14964/files#diff-c28e817ab2f95efdc57a5c4697751d2b4a607b75571f812738808ff7137e61c2, stuff them in a table, and call it a day. |
This should be correct even before this PR, given that the normalization is basically done with
810b405 for the zoom key (and some more). Not sure about others:
|
|
It looks like 810b405 reintroduces keycode-based defaults for some keybindings. Didn't we decide against mixing keycode-based and scancode-based defaults? (Does the keycode-based (I think what appgurueu asked for is merely showing the dialog as well if you use the default keybindings, and the default keybindings have changed on your keyboard layout due to the move from keycodes to scancodes. Currently you would only see the dialog if you have non-default keybindings set.) |
We did (and I did as well). However, the approach here is IMO better than the idea at the time of putting keycode-based keybindings directly into
Yes; although there is the possibility of going against binding keys in the (potentially) shifted state, which I decided for e.g.
I know, but doing this for changed keybindings would not be much simpler (and: should we show this on startup for new installations? if not, we also need to be able to determine that), and IMO it is better UX-wise to adjust such keybindings ourselves now that this is doable without significant breakages (see above). |
|
The "show dialog when default keybindings are used and have changed due to the move to scancodes" request is still valid with 810b405 though.
Well then at least a keycode default for
No, we shouldn't. That's something I was also going to bring up. The only approach to detect this I really see is "assume first launch when creating a new minetest.conf, store setting indicating that dialog should not be shown", which is not as straightforward as it would ideally be. (A hacky alternative could be checking some unrelated setting that's only present after first launch.) |
It can still be used for situations where luanti/builtin/mainmenu/dlg_rebind_keys.lua Lines 90 to 94 in 810b405
Another (simpler) idea would be to reword the dialog to prompt the user (once) to change keybindings as the default may be suboptimal (related: #16053). |
Co-authored-by: grorp <gregor.parzefall@posteo.de>
This comment was marked as resolved.
This comment was marked as resolved.
This turned out to be not as complicated as I initially thought: 5cd5020 (That said, I decided to take the somewhat lazy path of unconditionally showing the migration warning if the user upgrades and |
Co-authored-by: sfan5 <sfan5@live.de>
Co-authored-by: sfan5 <sfan5@live.de>
sfan5
left a comment
There was a problem hiding this comment.
looks good so far, will test later.
Co-authored-by: sfan5 <sfan5@live.de>
SmallJoker
left a comment
There was a problem hiding this comment.
☑️ New installation (faked it) --> dialog is not shown
☑️ Existing installation without no_keycode_migration_warning --> dialog is shown
☑️ Existing installation with no_keycode_migration_warning = true --> dialog is not shown (because it was already shown before)
☑️ The setting values are preserved if there's no change (SDL -> SDL, Platform-Native -> Platform-Native. --> the dialog is shown anyway (once). This is also valid because / (in my case) Shift+7 was rebound to -.
For some reason, the German translation of "Dismiss" is currently "Ablehnen" (= reject/refuse/dismiss), which may match in some cases - here it's misleading because the change won't/can't be reverted. Might "Ignore" be a better choice?
Anyway - the PR works, thus I approve again.
Just "Close"? |
grorp
left a comment
There was a problem hiding this comment.
my earlier concerns have been resolved
code looks good
I haven't tested
(also doesn't necessarily have to be red. the MTG dialog's dismiss button was just red as a warning because it would effectively make your MTG worlds disappear from the menu.) |
Both done in 71bb3db |
Followup for #14964; mentioned (using the "check for keycode-based setting" approach here) in #14964 (comment)
It automatically converts older keycodes to scancodes using a newly introduced
core.normalized_keycodefunction. The warning dialog is shown if the setting for a key is changed.No.
No.
UX. It was agreed that this is needed to notify users about this change.
To do
This PR is Ready for Review.
How to test
Set e.g.
and observe that
SYSTEM_SCANCODE_.