Commit Graph

14 Commits

Author SHA1 Message Date
Tong Mu
0ac05f1c5c
[Keyboard, Web] Map from "Esc" to the Escape key (#106133)
* Impl

* Fix build

* Add test
2022-06-21 13:27:12 -07:00
Tong Mu
ddeb0b99c5
[gen_keycodes] Remove invalid Web code maps (#106074)
* Impl

* Test
2022-06-16 13:53:23 -07:00
Michael Goderbauer
40a2689b9c
enable unnecessary_late (#96417) 2022-01-12 21:10:19 -08:00
Ian Hickson
f90b019c68
Enable prefer_relative_imports and fix files. (#91573) 2021-10-11 10:28:07 -07:00
Tong Mu
a7899c1961
[gen_keycodes] Remove nonexistent Web keys and improve their emulation (#87098) 2021-07-29 16:44:06 -07:00
Tong Mu
c6a24e3fb2
[gen_keycodes] Move GLFW keys to logical_key_data (#87086) 2021-07-27 14:49:05 -07:00
Tong Mu
c8d0b1d9db
New scheme for keyboard logical key ID (#85121)
This PR updates the ID used by logical keyboard keys.

The logical key ID is still composed of 2 parts: 32 bits of value, and 8 bits of plane. But the assignment of planes has been drastically changed. HID plane is removed, and unprintable plane and Flutter plane are added. This is to reflect the new generation method for logical key IDs. Now keys that are defined by Flutter but not by dom_key_data are placed into the Flutter plane, including numpad keys, sided modifier keys, and gamepad keys. The values for platform planes have also been adjusted.

The generation script and README have been updated accordingly as well.

A new file, test_utils/key_codes.h is now generated to assist engine unit testing.

All lists generated by the script are now sorted by the key.
2021-07-14 13:07:22 -07:00
Ahmed Ashour
a3dc90c4f5
Add space before curly parentheses. (#85306) 2021-07-01 13:51:05 -07:00
Greg Spencer
88f3811055
Turn on avoid_dynamic_calls lint, except packages/flutter tests, make appropriate changes. (#84476)
This adds avoid_dynamic_calls to the list of lints, and fixes all instances where it was violated.

Importantly, this lint is NOT turned on for flutter/packages/test, because those changes are happening in another PR: #84478
2021-06-14 14:16:57 -07:00
Greg Spencer
6b087c74e2
Add iOS key map generation, make macOS var naming consistent with repo (#83146)
This adds iOS key map generation that uses std::maps. It uses std::maps because on iOS if we use NSDictionaries, then when XCode loads the dylib, the initialization of those status NSDictionaries hasn't yet occurred, and it crashes the app. std::maps have a well-defined static behavior, and are correctly initialized.

I also made the naming of variables, fields, etc. consistent for macOS. We variously had macosFoo, macOSFoo, and macOsFoo. I eliminated macOsFoo and macosFoo, since the rest of the repo uses macOSFoo for lowerCamelCase names (with only a few exceptions). I used iOSFoo for iOS.
2021-05-25 17:18:06 -07:00
Greg Spencer
af3337b676
Add Enter and Tab back in to ios and macos key maps (#81865)
I noticed that tab traversal stopped working on iOS when #73440 was landed.

It seems to be that the control characters were excluded from the list of logical keys, and so they ended up being generated values.

This PR just adds "Enter" and "Tab" to the list for both macOS and iOS.
2021-05-11 10:23:11 -07:00
Tong Mu
0e251e0ae1
[key_codegen] Remove webValues (#81678)
Removes webValues from logical_key_data.json. Web's logical mapping should map webNames to logical key values, i.e. entry.value.
2021-05-10 03:16:25 -07:00
Phil Quitslund
96e4b47f5d
sort directives (#81624) 2021-05-02 07:24:01 -07:00
Tong Mu
9956a35a5a
Hardware keyboard: codegen (#73440)
Rewrites tools/gen_keycodes, the script that generates key mappings across the framework and the engine.
2021-04-30 21:06:03 -07:00