Commit Graph

72 Commits

Author SHA1 Message Date
Michael Goderbauer
06b9f7ba0b
docimports for services (#151134)
Part of https://github.com/flutter/flutter/issues/150800
2024-07-02 17:30:41 +00:00
Jenn Magder
65e8ec2140
Update gen_keycodes templates (#146481)
1. Change chromium default branch from master (404) to main.
2. When I migrated the template to ARC is triggered a `-Wobjc-redundant-literal-use` error, so fix that.  Engine PR is https://github.com/flutter/engine/pull/51981
3. Update to `FLUTTER_SHELL_PLATFORM_EMBEDDER_TEST_UTILS_KEY_CODES_G_H_` to match https://github.com/flutter/engine/pull/49006

This only updates the template and the script--I ran the script to validate it worked and built in the engine, but did not check in the actual generated key code changes (filed https://github.com/flutter/flutter/issues/146480 for that).
2024-04-12 20:07:11 +00:00
Loïc Sharma
51e607082f
[Windows] Remove header guard from generated key map (#140082)
The generated file is a `.cc` file that does not need header guards. This change updates the template that's used to generate that `.cc` file.

No tests as this is a refactoring with no semantic changes.

The generated `.cc` file in the engine will be updated by https://github.com/flutter/engine/pull/48993
2023-12-13 23:54:48 +00:00
Greg Spencer
1b9cab7138
Clean up synonyms, key code generation. (#138192)
## Description

This cleans up how synonyms are calculated, and adds a reverse mapping from pseudo keys to the real keys they are synonyms of.

Updates the `layout_goals.json` to include the "Space" key, since that was added in the engine without updating the generation configuration.
2023-11-13 20:13:00 +00:00
Bruno Leroux
5628ebf662
[RawKeyboard] Allow inconsistent modifiers for Web (#114499)
Co-authored-by: Bruno Leroux <bruno.leroux@gmail.com>
2022-11-07 20:41:09 +00:00
Tong Mu
d87faf921d
[Keyboard, iOS] Generate iOS's special key mapping (#106909) 2022-07-13 22:40:06 +00:00
Tong Mu
9970481b7a
[gen_keycodes] Mark generated file names with infix .g. (#106142) 2022-06-30 00:08:08 +00:00
Alexandre Ardhuin
bbdf617034
Export public API types from services/*.dart library (#106316) 2022-06-28 20:26:06 +00:00
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
Tong Mu
a92f0ef14f
[Keyboard, Android] Generate keyboard codes (#104032) 2022-05-19 18:38:06 -07:00
Tong Mu
65ea76718f
[gen_keycode, RawKeyboard] Apply derived keyboard layout from Linux (#102709) 2022-05-11 20:04:14 -07:00
Tong Mu
c5e3e1cf5f
RawKeyboardMacos accepts a new field "specifiedLogicalKey" (#100803) 2022-04-14 11:24:11 -07:00
moko256
13bf7515f4
Web: treat modifier key without location (#98460) 2022-03-15 19:50:10 -07:00
Tong Mu
32d78ab40c
[Windows, Keyboard] Fix logical key for PrintScreen (#94454) 2021-12-01 14:24:04 -08: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
caf876cf40
Reland: Keyboard events (#87174) 2021-07-29 14:24:03 -07:00
Tong Mu
2f4f170dd2
Revert "Keyboard events (#83752)" (#87171)
This reverts commit 5f792ba170.
2021-07-28 02:32:08 -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
5f792ba170
Keyboard events (#83752) 2021-07-26 12:28:05 -07:00
Greg Spencer
2cb685e157
Modify key info generation for new iOS key code. (#83439)
The (new, not yet used) code gen for iOS was setting up a std::map from key codes to logical and physical key codes, but it was using uint32_t, which isn't big enough to hold the Flutter key codes.

Also, iOS needs to be able to filter out function keys, so I added a function key set.
2021-07-20 04:24:43 -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
Mouad Debbar
4013fe2131
[web] Remove the part directive from the web key map template (#85637) 2021-06-30 14:26:04 -07:00
Tong Mu
32203c391f
Key codegen for Hardware Keyboard: Linux (GTK) #82962 2021-06-17 02:14:44 -07:00
Anis Alibegić
c99ed373b3
Fixed large amount of spelling errors (#83744) 2021-06-02 10:14:06 -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
nt4f04uNd
80a2b6b015
Fix typos (#82589) 2021-05-20 17:19:09 -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
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
Tong Mu
dbcac7f177
Reland Make LogicalKeyboardKey.keyLabel a getter and better #79100 (#79302) 2021-04-01 16:39:02 -07:00
Tong Mu
a603714610
Revert "Make LogicalKeyboardKey.keyLabel a getter and better (#79100)" (#79217) 2021-03-28 03:54:02 -07:00
Tong Mu
b60c855af5
Make LogicalKeyboardKey.keyLabel a getter and better (#79100) 2021-03-26 22:14:01 -07:00
Tong Mu
eb6e56761e
Revert "Remove keyLabel and debugName from Logical/PhysicalKeyboardKey (#78263)" (#79005)
This reverts commit 515ef91ba1.
2021-03-24 13:31:02 -07:00
Tong Mu
515ef91ba1
Remove keyLabel and debugName from Logical/PhysicalKeyboardKey (#78263)
- Remove `LogicalKeyboardKey.keyLabel`
- Make `Physical/LogicalKeyboardKey.debugName` getters
- Make `Physical/LogicalKeyboardKey()` factory constructors, which cache non-predefined instances.
2021-03-24 04:59:57 -07:00
Ian Hickson
341984237e
Const constructor audit. (#76162) 2021-02-17 19:46:04 -08:00
Robert Ancell
c65304bbf1
Map Linux AltGr to right alt. It was currently being ignored. (#73373)
Fixes https://github.com/flutter/flutter/issues/68713
2021-01-13 14:31:22 +13:00
Darren Austin
a6117269c6
Migrated some services and widgets doc comments to null safety. (#72792) 2020-12-23 17:14:04 -08:00
puelo
24d3999783
Generate RawKeyEvents for iOS 13.4+ (#65193)
* Added RawKeyEvent support for iOS

* Removed unused remnant

* added some missing keys

* Removed trailing whitespaces

* commit for build

* Added mapping names

* Made iOS keycodes generatable and collectable

* Fixed naming and formatting issues

* fixed raw_keyboard_test
2020-10-22 13:33:51 -07:00
Greg Spencer
199a7c1964
Fix the character field of the RawKeyEvent to hold correct data on non-Android platforms. (#65667)
This fixes a problem where the character field of the RawKeyEvent was not being set at all for non-Android platforms.

I also updated the key maps, and corrected a problem with the Windows key map where the backquote character wasn't correctly mapped.
2020-09-15 13:02:16 -07:00
Greg Spencer
041a3eaa84
Standardize the nullability of arguments to raw key data constructors. (#63523)
This standardizes the handling of nullability for the LogicalKeyboardKey.keyLabel and RawKeyEventData.keyLabel accessors so that they are non-nullable, but can be empty.

Before this change, the keyLabel could be either null or an empty string to indicate that there wasn't a label, which makes it harder to test for, since both need to be checked for. Since an empty string is sufficient, there is no need for it to be nullable.

Also, in raw_keyboard.dart, the web and Windows implementations wouldn't accept null values for parameters in the Map coming from the message, but tests were supplying null for some of them. This makes web and Windows creation of events match the other platforms, and makes the migration of tests to non-nullability easier.
2020-08-19 15:03:17 -07:00
Alexandre Ardhuin
7884420a0a
migrate services to nullsafety (#62513)
NNBD migration for services
2020-07-31 11:20:00 -07:00
Tong Mu
c177db172d
Refactor gen_keycode: Split generators (#61916)
* Split gen_keycode to make maintenance easier.
2020-07-29 13:20:07 -07:00
Robert Ancell
39f93d18b1
Add additional GTK keycodes for enter and tab (#61141) 2020-07-10 11:35:46 +12:00
Robert Ancell
8c3b826ebd
Support GTK keycodes (#59961) 2020-06-23 15:19:57 +12:00
Robert Ancell
8ae71a0e06
Fix the paths in keyboard map templates (#60015) 2020-06-23 15:18:54 +12:00
Francisco Magdaleno
a0f7f6ca6d
[windows] Adds support for keyboard mapping. (#54227) 2020-04-08 10:07:02 -07:00
Greg Spencer
289deef8c5
Add C++ code generation for key maps. (#50998)
This adds generation of some C++ keycode maps for various platforms.

This isn't meant for general use: it's so that the Flutter authors can keep the keycodes up to date with the Chromium and Android (and other) sources. It doesn't run continuously, it's only run occasionally (manually) to update the maps, because they don't change very often, and there is often manual work needed to make it function.

In this PR, I added output of various .cc files that write into an engine repo situated next to the flutter repo on disk. This is a starting point for implementing platform-side handling of key events.
2020-03-12 17:39:31 -07:00
Francisco Magdaleno
e9905b6ad8
[Keyboard] Collects windows key data (#52265) 2020-03-09 17:21:02 -07:00
Alexandre Ardhuin
8061894f05
update template for gen_keycodes (#49884) 2020-01-31 21:58:51 +01:00