schlosrat / token-health

FoundryVTT module
5 stars 10 forks source link

Numpad minus (-) key does not work in pop-up input field #5

Closed kenster421 closed 4 years ago

kenster421 commented 4 years ago

When adding health to tokens, the only way to do so is to use the number row minus key or by clicking the Heal button. The numpad minus key does not work.

tonifisler commented 4 years ago

Thanks for you report! I didn't experience that issue on my end. Could you provide some detail? Which system and modules are you using? Might be a conflict with another thing.

kenster421 commented 4 years ago

Brand new world with only the Token Health module created. Game system: PF2e. image

When applying healing using the minus key...

The numpad minus key does not work in the input field for health modification. image

Only the number row minus key works. image

tonifisler commented 4 years ago

Thank you for this clear explanation!

I don't think it's something coming from the module though, as I never try to handle this key with a custom function. The input is a plain type="number" and it should work with any minus. Can the NumLock on your keyboard be interfering with this?

I sadly cannot test this right now, I'm doing everything from my laptop, without a numpad at hand. I'll try again as soon as I have access to one.

kenster421 commented 4 years ago

You're very welcome!

I just tested this and NumLock On vs NumLock Off does not have any bearing on the ability to add a minus with the numpad minus key.

https://keycode.info/ shows the following info

Number row minus key: image

Numpad minus key: image

I hope this helps.

tonifisler commented 4 years ago

This helps! Thank you so much, I'll see if I can fix this then

Norc commented 4 years ago

For what it's worth, i couldn't reproduce this with Foundry 0.5.5 and Token Health 0.1.5, both minus keys were interpreted as negative values as expected for me..

kenster421 commented 4 years ago

I'm going to close this issue, @tonifisler. Thank you, @Norc, for making me look further into this issue. It appears that my numpad minus key does not work in text inputs in Foundry at all when the game is launched. Before the game is launched, it works in the edit world screen just fine.

The numpad minus key does seem to work on the game screen to zoom out of the tabletop view.

I don't think this is a specific problem with my keyboard because the onscreen keyboard for windows shows the same behavior.

In any case, thanks for looking into this.

tonifisler commented 4 years ago

No problem! Maybe report this to Atropos as this issue might be caused by Foundry itself. 🤔

kenster421 commented 4 years ago

A quick search of the Discord led me to a hotfix for 0.5.5 pinned in the beta temp discussion by Atropos. I regret that I didn't do this sooner. I applied the hotfix to my installation and everything is working fine now.

I like the change you made with the separate binding for health and keeping the old functionality of using negative values too.

tonifisler commented 4 years ago

No problem, I didn't remember that was something he was fixing in the hotfix.

Thank you so much! If you have any request or feedback, you're welcome to open other issues 😉