You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason for this behavior is the fact that in this scenario event.code is equal to NumpadEnter but event.key is equal to Enter Therefore when iterating over all keyboard handlers @onKey('Enter') will also be called since event.key will match. I found an older pull request #135 in which the option is discussed the specify a mode, this would enable developers to explicitly specify state if the they want to match based on key or code. Having this option would solve the problem at hand, but I understand that this proposal didn't make it in the final API design. But would it be possible to combine @onKey('Enter') and @onKey('NumpadEnter')? Let me know if I could help in any way.
The text was updated successfully, but these errors were encountered:
Due to the fact that both key and code are checked when determining if a key is triggered, a keyboard handler could be called multiple times.
The following function will be called twice when pressing
NumpadEnter
The reason for this behavior is the fact that in this scenario
event.code
is equal toNumpadEnter
butevent.key
is equal toEnter
Therefore when iterating over all keyboard handlers@onKey('Enter')
will also be called sinceevent.key
will match. I found an older pull request #135 in which the option is discussed the specify a mode, this would enable developers to explicitly specify state if the they want to match based on key or code. Having this option would solve the problem at hand, but I understand that this proposal didn't make it in the final API design. But would it be possible to combine@onKey('Enter')
and@onKey('NumpadEnter')
? Let me know if I could help in any way.The text was updated successfully, but these errors were encountered: