Many browsers, for example Chrome on Android will not allow audio to
play unless it's initiated from a user action. It is not reasonable to
display an error for this. Fixes issue #821.
It doesn't need to be this general as the issue is mostly about
Windows. Also use the same modifier shuffle that RealVNC and
TigerVNC uses to get macOS working well.
The fields provided cannot tell us if it is the left or right
version of the key that's pressed, so they are inherently unreliable.
It is also not a huge problem in practice as we'll get in sync on
the next press or release of the modifier.
Look up keys that are independent of layout and state first,
followed by keys that are only mild variations in layouts.
This is more robust as there might be multiple physical keys
generating the same symbols, and Keysyms don't map directly to
Unicode in all cases.
At the same time switch over to using the modern, standardised
'code' field for lookup.
Use the more modern 'key' field, and remove some legacy fallbacks
that are no longer required. This also removes the "stall" mechanism
as it is not needed with current browsers.
Commit fa5b334dcb by Joel Martin changed
getQueryVal() to always decode the value using decodeURIComponent(), but
unescape() is still used for extracting the title, leading to
double-unescaping.
As unescape() is deprecated anyway, remove the last user.
Cc: Joel Martin <github@martintribe.org>
Cc: Anthony Young <sleepsonthefloor@gmail.com>
There is a drag-threshold in the panning code which the tests didn't
account for. This caused the tests to fail when window.devicePixelRatio
was higher than 1.
Setting a style to null does restore it in FF, Chrome, Safari and Edge.
But it does not work in Internet Explorer. The proper way to restore to
default values is to set it to the empty string. This works in all
browsers. Fixes issue #808.
If down is false we can't just toggle the current internal state, even
though this is correct most of the time. There are cases where we don't
get the down event and thus won't have a correct internal state. For
example, when clicking in the session after using the clipboard
textarea.
If down is false, we always want to send a mouse event with the button
in 'up'-state.