- From: Florian Bösch <pyalot@gmail.com>
- Date: Thu, 31 Jan 2013 12:43:24 +0100
- To: Bjoern Hoehrmann <derhoermi@gmx.net>
- Cc: www-dom@w3.org
- Message-ID: <CAOK8ODh4zH+bDCVvBHariPcFVieXzy=gZRGDAWzqbz2fU7VSTw@mail.gmail.com>
I don't think figuring out how close X is to Y is relevant, at all. And I did not imply or ask for it. What is relevant is the following: #1: That there is a key-code that is reliable, unmodified and can be used by an application to react to shortcuts. This code would be saved in shortcut presets and be used to store modified shortcut schemes. Fortunately Event Level 4 introduces just such a code attribute to the event, so we're fine there. #2: A shortcut mapping dialog will need to display to the user a listing of shortcuts that are configured. Examples of this are found in every shortcut key dialog in existence such as: - Blender: http://codeflow.org/entries/2013/jan/30/keyboard-events-in-javascript-are-broken/blender.png - Gimp: http://codeflow.org/entries/2013/jan/30/keyboard-events-in-javascript-are-broken/gimp.png - Minecraft: http://codeflow.org/entries/2013/jan/30/keyboard-events-in-javascript-are-broken/minecraft.png If we where to use the Event Level-4 code attribute for this a shortcut would be displayed as "ControlLeft+KeyZ" regardless of weather the KeyZ is actually the key Y (german), the key "<" (Turkish) or no key to be found on that keyboard at all (Arabic). Besides the obvious usability issue, it's also not as user friendly as "ctrl+z". To solve that a suggestion has been made to add a function to translate a key code (as defined by DOM Event Level-4) to a users locale unmodified primary keyboard symbol: window.KeyboardEvent.queryKeyCap(event.code) I think that is a very good suggestions (it's better than my original suggestion to add it to the event) because it also aides with the display of presets/configurations of shortcuts regardless of locale. On Thu, Jan 31, 2013 at 12:26 PM, Bjoern Hoehrmann <derhoermi@gmx.net>wrote: > * Florian Bösch wrote: > >I have written a blog post at length about this issue here: > > > http://codeflow.org/entries/2013/jan/30/keyboard-events-in-javascript-are-broken/ > > http://lists.w3.org/Archives/Public/public-webapps/2013JanMar/0170.html > You seem to have double-posted this to the public-webapps list, where > most of the discussion seems to be archived now. I note that solutions > to some of the problems you mention have to account for the fact that if > non-isolated scripts can know, say, how close "x" and "y" are to each > other on a keyboard, that information would contribute identifying in- > formation that is likely to be used to track users. Last I heard people > wanted to avoid adding such information as much as possible. > -- > Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de > Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de > 25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ >
Received on Thursday, 31 January 2013 11:43:53 UTC