How were KeyMeaning values chosen?

5 views
Skip to first unread message

Filip Filmar

unread,
Dec 1, 2021, 9:05:23 PM12/1/21
to ui-inp...@fuchsia.dev
Hi folks!

How were KeyMeaning values chosen?

There are reserved areas in that enum value space, but it is not obvious to me what they are reserved for.

Thoughts?

F


Alice Neels

unread,
Dec 3, 2021, 4:25:29 PM12/3/21
to Filip Filmar, ui-inp...@fuchsia.dev
I think I copied them over from input2 and they were originally added by Viktar. Perhaps ask him?

-A

--
All posts must follow the Fuchsia Code of Conduct https://fuchsia.dev/fuchsia-src/CODE_OF_CONDUCT or may be removed.
---
You received this message because you are subscribed to the Google Groups "ui-input-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ui-input-dev...@fuchsia.dev.
To view this discussion on the web visit https://groups.google.com/a/fuchsia.dev/d/msgid/ui-input-dev/CAGEh6bhXS5FVM3GLWugzxhegUzD2Wj-wthp9zCatCT339SB_BQ%40mail.gmail.com.

Filip Filmar

unread,
Dec 3, 2021, 5:44:37 PM12/3/21
to Alice Neels, ui-inp...@fuchsia.dev
Thank you!

Will do and will report back for posterity.

F

Filip Filmar

unread,
Dec 15, 2021, 3:06:50 PM12/15/21
to ui-inp...@fuchsia.dev
On Fri, Dec 3, 2021 at 2:44 PM Filip Filmar <fm...@google.com> wrote:
Thank you!

Will do and will report back for posterity.

Here's the info we got from prior maintainer. Leaving here for posterity. 
IIUC, the values were chosen to ensure that there is enough reserved space to backfill the keys which we anticipate we'll add, and then in exactly the same ordering as they appear in the relevant W3C documentation.

This may seem obvious, but I'll leave a few links here for the record.
Input2's definition of KeyMeaning was `SemanticKey`: 
https://fuchsia.googlesource.com/fuchsia/+/dc5682915ca587a401796dfd2df04b7f5b287c46/sdk/fidl/fuchsia.ui.input2/events.fidl#29
Which was based on W3C's named key attribute values:
https://fuchsia.googlesource.com/fuchsia/+/dc5682915ca587a401796dfd2df04b7f5b287c46/sdk/fidl/fuchsia.ui.input2/semantic_keys.fidl#7
https://www.w3.org/TR/uievents-key/#named-key-attribute-values
The "reserved" block is an attempt to keep enum values together for same types of the keys, i.e. when a new modifier is added, it would be added in the "modifiers" block rather than get a new number at the end of the list.
So, no practical purpose, just long-term API health consideration. 
Reply all
Reply to author
Forward
0 new messages