Commit Graph

20 Commits

Author SHA1 Message Date
Pierre Ossman 3f1cda2e37 Enforce space before code block 2018-09-06 17:29:26 +02:00
Juanjo Diaz 2b5f94fa6a Prefer const/let over var 2018-05-24 00:27:09 +03:00
Juanjo Diaz 8727f598c2 Add eslint and fix reported issues 2018-05-24 00:25:44 +03:00
Juanjo Diaz 59ef29163e Move browser checks to browser.js 2018-01-30 08:35:47 -08:00
Pierre Ossman e7c4d669f0 Handle iOS special keys 2017-06-21 14:02:24 +02:00
Pierre Ossman 9782d4a324 Use KeyboardEvent.key too look up keysyms
And emulate it on browsers where it is missing or incorrect. This
makes the code more future oriented as it primarily uses the standardised
fields.
2017-05-04 12:13:48 +02:00
Pierre Ossman bf43c26319 Clean up AltGraph handling
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.
2017-05-04 12:13:48 +02:00
Pierre Ossman f7363fd26d Move keyboard handling in to Keyboard class
Replace the multi stage pipeline system with something simpler.
That level of abstraction is not needed.
2017-05-04 12:13:47 +02:00
Pierre Ossman 9e6f71cb75 Remove modifier synchronisation
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.
2017-05-04 12:13:47 +02:00
Pierre Ossman a784a9cabc Remove QEMU key event handler
The normal event handler provides all the necessary information
now, so it is no longer needed.
2017-05-04 12:13:47 +02:00
Pierre Ossman f714f7deae Improve lookup of special keys
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.
2017-05-04 12:13:47 +02:00
Pierre Ossman bfa1b237b9 Improve character keysym 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.
2017-05-04 12:13:47 +02:00
Pierre Ossman 80cb8ffddd Use standard DOM identifiers for physical keys 2017-05-04 12:13:45 +02:00
Pierre Ossman a5c8a755e8 Hide internal keyboard functions
These may change and are not part of a stable API.

This also reindents the object functions to make sure they can
access private functions.
2017-03-24 11:53:16 +01:00
Pierre Ossman 0a865e15ff Remove character substitution
We can handle any Unicode codepoint now, so stop replacing symbols.
2017-03-24 11:35:36 +01:00
Pierre Ossman 524d67f283 Remove keysym names from keysymdef.js
They were incomplete and turned off in most cases so they served
little use besides adding complexity.
2017-03-24 11:16:53 +01:00
Solly Ross 6d6f0db0da Refactor ES6 module structure/split up Util
This commit restructures many of the ES6 modules, splitting them
up to actual export multiple functions instead of a single object.

It also splits up Util into multiple sub-modules, to make it easier
to maintain.

Finally, localisation is renamed to localization.
2017-03-21 17:39:05 -04:00
Solly Ross 3ae0bb0968 Uncomment ES6 module syntax
This removes the special comment part of the ES6 module syntax,
opting to enable ES6 module syntax by default.

It also appends `.js` to all import paths to better support in-browser
loading.
2017-02-26 16:30:37 -05:00
Pierre Ossman 115eedf69c Use Unicode keysym range as fallback
Not all Unicode codepoints have an equivalent named Keysym. But
there is a range in the Keysym namespace that can be used to map
any codepoint to.
2016-10-15 14:58:55 +02:00
Solly Ross bd5340c7ee Move input-related files into core/input
This commit moves all the input-related files from `core/`
to `core/input/`, and renames a couple as relevant
(input.js --> input/devices.js, keyboard.js --> input/util.js).
2016-09-16 15:49:52 -04:00