Hi There,

Thanks for the explanation & for the quick response!
Facing now 2 issues:
1.) KeyboardMap is not supported
<https://developer.mozilla.org/en-US/docs/Web/API/KeyboardLayoutMap> on
Safari (according to MDN)
2.) Does not work as supposed to (?)
Having a QWERTZ keyboard layout, once I press "y" (which is KeyZ), sending
event.code received ("KeyZ") to keyboardLayoutMap.get returns "z", instead
of "y":

*A KeyboardLayoutMap instance is a read-only Map-like object
<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map#map-like_browser_apis>,
in which each key is a string identifying the unique physical key on the
keyboard (a "key code"), and the corresponding value is the associated key
attribute value (which may be affected by the keyboard layout, and so on).*
See attached test script, just in case.
I still think a feature (part, component, element, method or property +
etc) should not be deprecated without another (standard) one using
which one can achieve the same goals (ideally in a better & quicker way..).

Best,
- Lorand.


On Tue, Nov 7, 2023 at 1:16 AM Gary Kačmarčík (Кошмарчик) <
gary...@google.com> wrote:

> This is the kind of issue that KeyboardMap (
> https://wicg.github.io/keyboard-map/) is meant to address.
>
> `keyCode` is not well defined, so once you get outside the common keys you
> see implementation differences between browsers and OSs. So there is no
> real path to creating a specification for it. Hence it is deprecated
> because it is not reliable.
>
> Also, this issue is about `keyIdentifier`, which Safari briefly supported.
> As of today, Safari supports `key` and `code`, so the concerns about not
> having a fallback for `keyIdentifier` are no longer relevant.
>
> -Gary
>
> On Mon, Nov 6, 2023 at 1:18 PM Lorand Zudor <lorand.zu...@gmail.com>
> wrote:
>
>> Hi All,
>>
>> Despite the fact that the given thread is from 2016 I think there's still
>> a scenario which can be resolved only using deprecated properties (
>> KeyboardEvent.keyCode or UIEvent.which).
>> Consider the following scenario:
>> - there is a given shortcut in a web app mapped for Control+Alt+Z
>> (alternatively Command+Option+Z for MacOs)
>> - let's also assume the user is having a qwertz
>> <https://en.wikipedia.org/wiki/QWERTZ> keyboard layout set
>> - on Mac, once Command+Option+Z is pressed, one can detect the right
>> combination only by using keyCode, since:
>> -- event.keyCode will be 90 (ASCII for "Z")
>> -- event.code takes "KeyY" (physical key)
>> -- event.key will be "Ź" (ASCII: 377); on default ABC layout is "Ω", so
>> that wouldn't work, either
>>
>> Best,
>> - Lorand.
>>
>> On Friday, September 9, 2016 at 2:09:35 AM UTC+3 Gary Kačmarčík
>> (Кошмарчик) wrote:
>>
>> We haven't heard anything from Apple regarding updating WebKit to use
>> |code| and |key|, so they don't have a non-deprecated alternative.
>>
>> We'll hopefully learn more about their plans during TPAC (later this
>> month), but for now Safari users need to fall back to the (also deprecated)
>> |keyCode| and |charCode| attributes. But as mentioned earlier, this
>> attribute was never widely implemented and was only included in the
>> standard for a very short period of time.
>>
>>
>> On Thu, Sep 8, 2016 at 3:19 PM, 'Joe Medley' via blink-dev <
>> blin...@chromium.org> wrote:
>>
>> I'm writing a notice about this for this page
>> <https://developers.google.com/web/updates/tags/deprecations>. Does
>> anyone know what the alternative is for Safari?
>>
>> Joe
>>
>> Joe Medley | Technical Writer, Chrome DevRel | jme...@google.com |
>> 816-678-7195
>> *If an API's not documented it doesn't exist.*
>>
>> On Wed, Apr 27, 2016 at 4:19 PM, Dave Tapuska <dtap...@chromium.org>
>> wrote:
>>
>> Primary eng (and PM) emails
>>
>> dtap...@chromium.org
>>
>> Summary
>>
>> Mark the field keyIdentifier on KeyboardEvent.idl as deprecated.
>>
>> Motivation
>>
>> There is a standardized KeyboardEvent.key which other vendors implement.
>> Deprecating the feature is desired to drive adoption of the newly available
>> key field.
>>
>> Compatibility Risk
>>
>> Edge, and FireFox do not implement this field so web developers have had
>> to work around the issue for some time.
>>
>>
>> Alternative implementation suggestion for web developers
>>
>> Use KeyboardEvent.key
>>
>> Usage information from UseCounter
>> <https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/core/page/UseCounter.h&sq=package:chromium&type=cs&q=file:UseCounter.h%20Feature&l=39>
>>
>> The use counter is relatively high with 0.2155%. But I do believe this
>> usage value is inflated due to cloning of all fields in Events by
>> delegation frameworks.
>>
>>
>> https://www.chromestatus.com/metrics/feature/popularity#V8KeyboardEvent_KeyIdentifier_AttributeGetter
>>
>> OWP launch tracking bug
>>
>> crbug.com/607349
>>
>> Entry on the feature dashboard <https://www.chromestatus.com/>
>>
>> https://www.chromestatus.com/features/5316065118650368
>>
>>
>> Requesting approval to remove too?
>>
>> No. Ideally since this has been around for a while; I'd like to give
>> probably 4 releases to fully deprecate it. So probably M56. But ideally the
>> motivation of doing this is to call out the usage of KeyboardEvent.key
>> instead.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "blink-dev" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to blink-dev+unsubscr...@chromium.org.
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "blink-dev" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to blink-dev+unsubscr...@chromium.org.
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to blink-dev+unsubscr...@chromium.org.
To view this discussion on the web visit 
https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAFbshin6i6rgMGQYoC7hWMgWCcL_enwCOWtb1hoyFFqaTSzkUw%40mail.gmail.com.
Title: Keyboard Map Testing

Keyboard Map Testing

Start Typing...

Reply via email to