Commit Graph

36 Commits

Author SHA1 Message Date
Robert Ancell
29827d75f3
Update gen_keycodes output to new engine location. (#162479)
The engine is now part of Flutter and doesn't need to have the path
configured.

The current code doesn't update the engine.
2025-02-11 00:52:03 +00:00
Michael Goderbauer
5491c8c146
Auto-format Framework (#160545)
This auto-formats all *.dart files in the repository outside of the
`engine` subdirectory and enforces that these files stay formatted with
a presubmit check.

**Reviewers:** Please carefully review all the commits except for the
one titled "formatted". The "formatted" commit was auto-generated by
running `dev/tools/format.sh -a -f`. The other commits were hand-crafted
to prepare the repo for the formatting change. I recommend reviewing the
commits one-by-one via the "Commits" tab and avoiding Github's "Files
changed" tab as it will likely slow down your browser because of the
size of this PR.

---------

Co-authored-by: Kate Lovett <katelovett@google.com>
Co-authored-by: LongCatIsLooong <31859944+LongCatIsLooong@users.noreply.github.com>
2024-12-19 20:06:21 +00:00
Pierre-Louis
4a65a76279
Reland: Update link branches to main (#146882)
Reland https://github.com/flutter/flutter/pull/146558, reverted in https://github.com/flutter/flutter/pull/146880 due to an outdated test result

## Original description

- Update CS and googlesource.com link branches
- Update GitHub /blob/ and /tree/ links

Tested links manually and fixes a few broken or deprecated links

Added a test that validates that `master` isn't used, except for specified repos.

Part of https://github.com/flutter/flutter/issues/121564
2024-04-17 13:16:33 +00:00
Pierre-Louis
33a9643b5d
Revert "Update link branches to main" (#146880)
Reverts flutter/flutter#146558

Causes failure
2024-04-17 13:25:18 +02:00
Pierre-Louis
072b8874a0
Update link branches to main (#146558)
- Update CS and googlesource.com link branches
- Update GitHub /blob/ and /tree/ links

Tested links manually and fixes a few broken or deprecated links

Added a test that validates that `master` isn't used, except for
specified repos.

Part of https://github.com/flutter/flutter/issues/121564

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
[Data Driven Fixes]:
https://github.com/flutter/flutter/wiki/Data-driven-Fixes
2024-04-17 09:44:23 +02: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
Tong Mu
9970481b7a
[gen_keycodes] Mark generated file names with infix .g. (#106142) 2022-06-30 00:08:08 +00: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
Ian Hickson
61a0add286
Enable avoid_redundant_argument_values lint (#91409) (#91462) 2021-10-08 09:25:14 -07:00
Zachary Anderson
b9d2177da0
Revert "Enable avoid_redundant_argument_values lint (#91409)" (#91461)
This reverts commit 5fd259be24.
2021-10-07 21:11:07 -07:00
Ian Hickson
5fd259be24
Enable avoid_redundant_argument_values lint (#91409) 2021-10-07 20:13:02 -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
Alexandre Ardhuin
34059eec2c
enable lint prefer_interpolation_to_compose_strings (#83407) 2021-06-01 11: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
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
Phil Quitslund
61c30c41b2
fix sort_directives violations (#80817) 2021-04-21 13:49:03 -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
Michael Goderbauer
cb867bbedc
Enable unnecessary_await_in_return lint (#77434) 2021-03-05 18:38:15 -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
Michael R Fairhurst
7f3c9b6bda
Remove unused 'dart:async' imports. (#65568) 2020-09-16 14:14:06 -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
8c3b826ebd
Support GTK keycodes (#59961) 2020-06-23 15:19:57 +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
3800bb7b10 fix missing spaces in adjacent strings (#49159) 2020-01-21 16:43:03 -08:00
Alexandre Ardhuin
ec1a015045
implicit-casts:false in dev (#45787) 2019-12-05 22:34:06 +01:00
Ian Hickson
449f4a6673
License update (#45373)
* Update project.pbxproj files to say Flutter rather than Chromium

Also, the templates now have an empty organization so that we don't cause people to give their apps a Flutter copyright.

* Update the copyright notice checker to require a standard notice on all files

* Update copyrights on Dart files. (This was a mechanical commit.)

* Fix weird license headers on Dart files that deviate from our conventions; relicense Shrine.

Some were already marked "The Flutter Authors", not clear why. Their
dates have been normalized. Some were missing the blank line after the
license. Some were randomly different in trivial ways for no apparent
reason (e.g. missing the trailing period).

* Clean up the copyrights in non-Dart files. (Manual edits.)

Also, make sure templates don't have copyrights.

* Fix some more ORGANIZATIONNAMEs
2019-11-27 15:04:02 -08:00
Greg Spencer
f0978c225a
Game controller button support (#33868)
This adds support for game controller buttons. It adds some supplemental USB HID codes that aren't available from the Chromium source code, and maps those on Android to the game pad buttons that Android supports. Other platforms are not supported yet.
2019-06-05 16:23:17 -07:00
Francisco Magdaleno
b70d260b3c
Adds the keyboard mapping for Linux (#29993) 2019-03-28 10:04:23 -07:00
Greg Spencer
2aad59314f
Add a keyboard key code generator. (#27620)
This adds a keycode generator that incorporates input from the Chromium and Android source trees, as well as some local tables, to generate static constants for the LogicalKeyboardKey and PhysicalKeyboardKey classes, as well as mappings from each of the platforms we support so far (currently only Android and Fuchsia).

This code generator parses the input files, generates an intermediate data structure (`key_data.json`) that is checked in, and then generates the Dart sources for these classes and some static maps that will also be checked in (but are not included in this PR).

The idea is that these codes don't change often, and so we don't need to generate them on every build, but we would like to be able to update them easily in the future if new data becomes available. If the existing data disappears or becomes unusable, we can maintain the checked-in data structure by hand if necessary, and still be able to generate the code.

This PR only contains the code generator, not the classes themselves. In another follow-on PR, I'll run the generator and check in the output of the generator.
2019-02-06 16:53:16 -08:00