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

Keyboard not working with NumberInput #261

Open
Ultraxime opened this issue Jul 16, 2024 · 13 comments · Fixed by #262
Open

Keyboard not working with NumberInput #261

Ultraxime opened this issue Jul 16, 2024 · 13 comments · Fixed by #262

Comments

@Ultraxime
Copy link
Collaborator

Hello,

I'm working with iced_aw 0.9.3 and iced 0.12.1 and experiencing an issue with the NumberInput.
I can't write inside using the numpad or upper line of my keyboard; whether it's focused or if the mouse is over it.

I even tried to fork the repository and run the example and, I came to the same issue.

So before trying to fix it myself, I was wondering if it's my fault or not.
I'm running it on Archlinux with Rustc 1.79.0.

The issue also occurred on a computer running Windows.

Thanks in advance

@genusistimelord
Copy link
Collaborator

You can write inside, but there are limitations atm till we figure out how to deal with them.
You can not write a - or a . Inside the text box. This is due to floating points and signed versus unsigned. We do not yet have a way to easily know the difference from a generic.
You can only write numbers, but that is limited to the min and max settings of the number input.

@Ultraxime
Copy link
Collaborator Author

Maybe it's because of my French layout, but the numbers above the keyboard do not work and in the num pad I can only write 4 and 6 (2 and 8 acting as arrows and the rest does nothing)

@genusistimelord
Copy link
Collaborator

Ahh yeah, idk if Iced supports different Layouts other than the qwerty English layout.

@Ultraxime
Copy link
Collaborator Author

So I'm going to dive into it, because I don't have issues with iced's widgets including Textinput
And maybe I'll find a fix to this and propose it here

@genusistimelord
Copy link
Collaborator

We do accept PR's so that is fine. I just dont know what the cause would be.

@Ultraxime
Copy link
Collaborator Author

I don't know either, hence my question

@genusistimelord
Copy link
Collaborator

oh I think you are right though the numberpad numbers do not output at all. I'll see why.

@Ultraxime
Copy link
Collaborator Author

I found out why, and I'm going to correct it.
It's because the key on the number pad are named even when the number are activated, so the code never reach the part where it tries to add the number

@genusistimelord
Copy link
Collaborator

we need to ensure that numlock is enabled before we look at the numbers though. I will let you know what I find in winit on how to know this.

@Ultraxime
Copy link
Collaborator Author

Ultraxime commented Jul 16, 2024

With Numpad activated :

KeyPressed { key: Named(ArrowDown), location: Numpad, modifiers: Modifiers(0x0), text: Some("2") }

without

KeyPressed { key: Named(ArrowDown), location: Numpad, modifiers: Modifiers(0x0), text: None }

So we just have to look at the text field, and same goes for the upper line of the French keyboard

@genusistimelord
Copy link
Collaborator

ok yeah they had no means or actually knowing but i guess this works with Text so its good that works.

@Ultraxime
Copy link
Collaborator Author

It seems that with #309 I broke once again the logic on the number input.
The numpad of at least french keyboard is not working.
Can you reopen the issue and I'll try to solve it once again

@genusistimelord
Copy link
Collaborator

Reopening for another known issue.

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

Successfully merging a pull request may close this issue.

2 participants