Skip to content
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

programmatic keyboard focus to ColorPicker's hex field #328

Closed
ryanastout opened this issue Jul 5, 2020 · 3 comments
Closed

programmatic keyboard focus to ColorPicker's hex field #328

ryanastout opened this issue Jul 5, 2020 · 3 comments

Comments

@ryanastout
Copy link

ColorPicker has a private ExtendedColorPicker called picker. ExtendedColorPicker extends BasicColorPicker. BasicColorPicker has a private VisValidatableTextField called hexField. I'd like to be able to programmatically give keyboard focus to the hexField. However, because hexField is private, there's no way to get a reference to it in order to call
Stage.setKeyboardFocus() passing hexField (It also doesn't have name, so there's no way to search for it by name).

This issue is to request adding some way to get access to a reference to the hexField member in order to set the keyboard focus, or to add a method to ColorPicker to request that it set the keyboard focus to the hexField

@kotcrab
Copy link
Owner

kotcrab commented Jul 5, 2020

I guess it makes sense to focus this field on show by default. Same for the FileChooser's selected file text field.

@ryanastout
Copy link
Author

I'm not sure focusing by default would take care of all relevant use-cases. For example, imagine I want to add the hex field to a list of Actors that I'd cycle focus through with the tab button. I'd need to be able to get a reference to the field in order to focus on it in response to certain user inputs.

@kotcrab kotcrab closed this as completed in 645a27c Jul 6, 2020
@kotcrab
Copy link
Owner

kotcrab commented Jul 6, 2020

I've added method for focusing the hex field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants