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
Class component.Key is practically unsable with KeyDownEvent #4626
Comments
I don't fully understand what you are describing, but you can use password.addKeyDownListener(Key.ENTER, event -> pressed()); Methods |
My bad, I didn't see the modifiers were an optional parameter. This solves my main issue. This does not however solve the issue that |
The |
I see. I just feel like the interface is unintuitive. Being unable to compare one key to another easily. I think the use case is when a user wants to manually check what key was pressed. I guess the issue then comes down to "When would someone want to do this?" but I don't know. Other than the inability to use this |
I agree with @Bloodust :
This API is completely broken by design. There's even |
It would be helpful if you at least provide convenient checker methods in Key and KeyModifier that allow me to verify that a specific Key and a specific KeyModifier were pressed as indicated by the key event listener methods. For instance, something like:
|
One thing I don't really understand here is that why to use Please elaborate @Bloodust @PAX523 @mvysny ? |
This ticket/PR has been released with platform 22.0.0.alpha4 and is also targeting the upcoming stable 22.0.0 version. |
This ticket/PR has been released with platform 21.0.2. |
This ticket/PR has been released with platform 20.0.8. |
Closed by 11837 |
Goal: Submit form when Enter key is pressed Or Call a method when Enter key is pressed
Code with comments that explain the insanity:
Key class is not actually a Key class, its Keys class because it contains multiple Keys inside of itself. I can understand the need for this when pressing down multiple keys eg. "ctrl+enter" but I dont think this is the way to do it.
Key need implement equals and toString. Key.Enter.equals(Key.Enter) makes sense.
The text was updated successfully, but these errors were encountered: