-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve ColorPicker picker shape keyboard and joypad accessibility #99374
base: master
Are you sure you want to change the base?
Improve ColorPicker picker shape keyboard and joypad accessibility #99374
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I support this usability improvement in the proposal design, but it needs technical review.
We should make the controller send fake echo events in this case, so that various GUI nodes can handle these directly. However, this should also be done in a way that doesn't affect existing game logic, which is going to be difficult to handle. Perhaps this should only be done for the built-in actions (those starting with Edit: Proposal opened: |
Co-authored-by: A Thousand Ships <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, it works as expected.
Some usability comments:
- The hue slider should go faster when you adjust it with the keyboard arrows or gamepad buttons. Compare its speed to the color value on the left:
color_value_vs_hue_slider.mp4
Ideally, the speed at which the hue is adjusted should match the color value on the left, which is probably 3× to 4× faster. This can be done by increasing the increment for each button press on the hue slider.
- When using a color picker with a wheel shape, moving upwards should "slide" along the circle when you've reached the top (same for any other edge):
color_value_wheel_slide.mp4
Right now, it stops so you need to manually move to the left then move back up again.
// HACK: I cannot draw focus stylebox on the wheel itself, as it's drawing based on shader. | ||
wheel_h_focus_display = memnew(Control); | ||
wheel_margin->add_child(wheel_h_focus_display); | ||
wheel_h_focus_display->set_mouse_filter(MOUSE_FILTER_PASS); | ||
wheel_h_focus_display->set_focus_mode(FOCUS_ALL); | ||
wheel_h_focus_display->connect(SceneStringName(draw), callable_mp(this, &ColorPicker::_hsv_draw).bind(3, wheel_h_focus_display)); | ||
wheel_h_focus_display->connect(SceneStringName(gui_input), callable_mp(this, &ColorPicker::_uv_input).bind(wheel_h_focus_display)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be able to draw a special circle focus stylebox (using a dedicated StyleBoxFlat in the editor theme/default project theme), so it matches the wheel's shape. This can be left for a future PR as it's not essential.
While experimenting with accessibility, I realized that ColorPicker does not allow you to move the picker cursor around the color rectangle/wheel with keyboard or joypad (and I needed it, as it's the only part of ColorPicker that I want to show).
This PR implements:
How it works in game and in the editor:
ColorPicker.keyaboard.and.joypad.game.mp4
ColorPicker.keyboard.editor.mp4
I don't really like how it works with the controller, as I'm using
gui_input
to check for actions and the controller does not send echo events, but it's possible to use the controller at least.