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

The commit 9600954 introduced a bug when using the numpad keys #2277

Closed
2 tasks done
alex-ds13 opened this issue Feb 21, 2024 · 6 comments · Fixed by #2278
Closed
2 tasks done

The commit 9600954 introduced a bug when using the numpad keys #2277

alex-ds13 opened this issue Feb 21, 2024 · 6 comments · Fixed by #2278
Labels
bug Something isn't working text widget
Milestone

Comments

@alex-ds13
Copy link
Contributor

alex-ds13 commented Feb 21, 2024

Is there an existing issue for this?

  • I have searched the existing issues.

Is this issue related to iced?

  • My hardware is compatible and my graphics drivers are up-to-date.

What happened?

After the commit 9600954, when pressing the numpad keys, instead of producing the specific character for that key it results in the keycode as if that key was pressed with Shift modifier. For example, on my keyboard the numpad key "1" can also be used as "End" when pressed with shift. But when I press it on Iced it is always getting that key event as "End" instead of "1", no matter if I'm pressing shift or not.

This means that I can't use the numpad to write numbers on a textinput.

What is the expected behavior?

Before the mentioned commit that doesn't happen, it produces a Character("1") when pressed normally and a Named(End) when pressed with shift, as expected.

Version

master

Operating System

Windows

Do you have any log output?

No response

@alex-ds13 alex-ds13 added the bug Something isn't working label Feb 21, 2024
@hecrj
Copy link
Member

hecrj commented Feb 21, 2024

Yes, the behavior was changed on purpose.

You should use the text field of the KeyPressed variant for any kind of user input.

@hecrj hecrj closed this as completed Feb 21, 2024
@hecrj hecrj added this to the 0.12.1 milestone Feb 21, 2024
@hecrj
Copy link
Member

hecrj commented Feb 21, 2024

Oh, I see you mean the TextInput widget is broken!

@hecrj hecrj reopened this Feb 21, 2024
@alex-ds13
Copy link
Contributor Author

But it's not me using anything. Its a problem on the TextInput. When I press the keys on Numpad it doesn't do anything!

@alex-ds13
Copy link
Contributor Author

Oh, I see you mean the TextInput widget is broken!

Yes. I didn't check if the TextEditor is as well or not...

@hecrj
Copy link
Member

hecrj commented Feb 21, 2024

Thanks for the report! #2278 should fix this.

@alex-ds13
Copy link
Contributor Author

Thanks for the report! #2278 should fix this.

Well that was quick! I can confirm that does fix it for me!

I tried to look in to the code to see if I could fix it, but since this was such a recent change I thought you probably could figure it out much faster, as it was! Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working text widget
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants