ID 500902 - Key Held Threshold Time has incorrect effect

Follow

Problem summary
Key Held Threshold Time has incorrect effect

Customer reported version
Mari 4.8v1

Customer reported platform
Windows 10

Steps to reproduce

1) Open any project

2) Open Preferences and go to Misc. > Toggle Tools

3) Change the Key Held Threshold Time to 2000ms

4) Ensure that the Tool On Key Held checkbox is ticked (you will need to restart Mari if this is changed)

5) Press the S key for quick and long periods, notice that it switches back to the previous tool when the hotkey is released no matter how long the key is pressed

6) In preferences, untick the Tool On Key Held checkbox

7) Restart Mari and open any project

8) Press hotkeys for different tools, notice that they will permanently switch after a short press

9) Hold down the hotkeys for over 3 seconds, notice that releasing them will switch back to the previous tool

Expected behaviour
When Tool On Key Held is enabled, if a hotkey is held for less than the Key Held Threshold Time then it should be recognised as a tap and permanently switch.
If a key is held longer than the Key Held Threshold time, then the tool should switch back when the key is released.

Actual behaviour
When Tool On Key Held is disabled, if a hotkey is held for less than the Key Held Threshold time then it permanently switches to the tool. If a hotkey is held for more than the Key Held Threshold time, then the tool switches back when the key is released.
 
When Tool On Key Held is enabled, the Key Held Threshold Time has no effect on the S hotkey. Other tool hotkeys have the same behaviour as when Tool On Key Held is Disabled.

Workaround
Unknown.

Reproduced by support
This bug has been reproduced in:
Mari 5.0v1 - Windows 10 - CentOS 7.9
Mari 4.8v1 - Windows 10
Mari 4.7v1 - Windows 10
Mari 4.6v1 - Windows 10 - CentOS 7.9

Earliest version tested
Mari 4.6v1 - This feature did not exist before this version

    We're sorry to hear that

    Please tell us why