iced_aw icon indicating copy to clipboard operation
iced_aw copied to clipboard

Keyboard not working with NumberInput

Open Ultraxime opened this issue 1 year ago • 13 comments

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

Ultraxime avatar Jul 16 '24 01:07 Ultraxime

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.

genusistimelord avatar Jul 16 '24 11:07 genusistimelord

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)

Ultraxime avatar Jul 16 '24 12:07 Ultraxime

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

genusistimelord avatar Jul 16 '24 12:07 genusistimelord

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

Ultraxime avatar Jul 16 '24 12:07 Ultraxime

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

genusistimelord avatar Jul 16 '24 12:07 genusistimelord

I don't know either, hence my question

Ultraxime avatar Jul 16 '24 12:07 Ultraxime

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

genusistimelord avatar Jul 16 '24 12:07 genusistimelord

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

Ultraxime avatar Jul 16 '24 12:07 Ultraxime

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.

genusistimelord avatar Jul 16 '24 13:07 genusistimelord

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

Ultraxime avatar Jul 16 '24 13:07 Ultraxime

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

genusistimelord avatar Jul 16 '24 13:07 genusistimelord

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

Ultraxime avatar Jan 24 '25 00:01 Ultraxime

Reopening for another known issue.

genusistimelord avatar Jan 24 '25 01:01 genusistimelord