Commit Graph

40 Commits

Author SHA1 Message Date
Michael Goderbauer
40a2689b9c
enable unnecessary_late (#96417) 2022-01-12 21:10:19 -08:00
Michael Goderbauer
5a862ebecd
Replace dynamic with Object? in SystemChannels (#94629) 2021-12-03 15:34:04 -08:00
Ian Hickson
f90b019c68
Enable prefer_relative_imports and fix files. (#91573) 2021-10-11 10:28:07 -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
Sam Rawlins
bcb5db7758
Remove "unnecessary" imports from packages/ (#89795) 2021-09-15 01:27:02 -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
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
5f792ba170
Keyboard events (#83752) 2021-07-26 12:28:05 -07:00
Michael Goderbauer
b0e51db8d5
Fixes for upcoming changes to avoid_classes_with_only_static_members (#86744) 2021-07-20 16:12:12 -07:00
Ian Hickson
5e0cc4cba4
Migrate to ChannelBuffers.push (#82564) 2021-05-21 15:09:03 -07:00
Tong Mu
01c98fa95e
Character activator (#81807) 2021-05-18 20:19:03 -07:00
Ian Hickson
2ae1e39810
Revert "Migrate to ChannelBuffers.push (#82057)" (#82525) 2021-05-14 12:09:03 -07:00
Ian Hickson
b86d5c0094
Migrate to ChannelBuffers.push (#82057) 2021-05-13 14:34:04 -07:00
Ren You
7f1d1414cc
Revert "Migrate to ChannelBuffers.push (#81235)" (#81829)
This reverts commit 35ad43f20c.
2021-05-04 06:17:19 -07:00
Ian Hickson
35ad43f20c
Migrate to ChannelBuffers.push (#81235) 2021-05-03 17:14:03 -07:00
Angjie Li
b74df388e1
Revert "Migrate to ChannelBuffers.push (#76288)" (#81226)
This reverts commit c26ed03c8a.
2021-04-26 12:57:17 -07:00
Ian Hickson
c26ed03c8a
Migrate to ChannelBuffers.push (#76288)
* Migrate to ChannelBuffers.push

* Move TestDefaultBinaryMessenger to its own file

* Apply deprecations and fix usages
2021-04-23 15:39:34 -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
Michael Goderbauer
cb867bbedc
Enable unnecessary_await_in_return lint (#77434) 2021-03-05 18:38:15 -08:00
Ferhat
cc9b78fc5c
[web] Treeshake keymaps for web (4% code size reduction in hello world) (#75945) 2021-02-25 13:26:03 -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
8c03ff8c1d
Mark keys that match a shortcut, but have no action defined as "not handled". (#67359)
- - When I added notification of key events before processing them as text, it made it so that shortcut key bindings like the spacebar would prevent spaces from being inserted into text fields, which is obviously not desirable (and so that change was reverted). At the same time, we do want to make it possible to override key events so that they can do things like intercept a tab key or arrow keys that change the focus.

This PR changes the behavior of the Shortcuts widget so that if it has a shortcut defined, but no action is bound to the intent, then instead of responding that the key is "handled", it responds as if nothing handled it. This allows the engine to continue to process the key as text entry.

This PR includes:

- Modification of the callback type for key handlers to return a KeyEventResult instead of a bool, so that we can return more information (i.e. the extra state of "stop propagation").
- Modification of the ActionDispatcher.invokeAction contract to require that Action.isEnabled return true before calling it. It will now assert if the action isn't enabled when invokeAction is called. This is to allow optimization of the number of calls to isEnabled, since the shortcuts widget now wants to know if the action was enabled before deciding to either handle the key or to return ignored.
- Modification to ShortcutManager.handleKeypress to return KeyEventResult.ignored for keys which don't have an enabled action associated with them.
- Adds an attribute to DoNothingAction that allows it to mark a key as not handled, even though it does have an action associated with it. This will allow disabling of a shortcut for a subtree.
2020-10-19 11:26:50 -07:00
Michael Goderbauer
19e07d2beb
Migrate flutter_test (#66663) 2020-09-30 17:03:40 -07:00
Michael R Fairhurst
7f3c9b6bda
Remove unused 'dart:async' imports. (#65568) 2020-09-16 14:14:06 -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
Francisco Magdaleno
a0f7f6ca6d
[windows] Adds support for keyboard mapping. (#54227) 2020-04-08 10:07:02 -07:00
cjng96
d62c7ecce5
Ignore key events on edit control on web platform (#52656) (#52661) 2020-04-01 00:31:03 -07:00
Greg Spencer
c5dd3ec47a
Fix stuck keys when shift is released before the letter. (#51095)
This fixes a problem where if you press "Shift" and then "A", then release "Shift" and then "a", then the "A" key will be "stuck" on because the logical key for the key down message is different (capital "A") from the logical key for the key up message (lowercase "a").

This PR changes the pressed keys logic so that it uses the physical key to add/remove keys from the list of pressed keys, but keeps the associated logical key.

This does mean that after the "Shift" key goes up, the pressed keys contains a capital "A" and it doesn't switch to be a lowercase "a", but there isn't currently any mechanism we can use to do that remapping. This is far less surprising than the current behavior, but is still not quite correct.

I fixed the event simulation code to take a physicalKey so that it could be matched with the logical key, but the event simulation code isn't up to the task, since it can only simulate keys that appear in the key maps. The new platform key event design should fix that (added TODOs).
2020-02-21 14:13:38 -08:00
Alexandre Ardhuin
4f9b6cf017
enable lint prefer_final_in_for_each (#47724) 2020-01-07 16:32:04 +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
028ed7122a
Synchronize modifier keys in RawKeyboard.keysPressed with modifier flags on events. (#43948)
Currently, we listen to keyboard events to find out which keys should be represented in RawKeyboard.instance.keysPressed, but that's not sufficient to represent the physical state of the keys, since modifier keys could have been pressed when the overall app did not have keyboard focus (especially on desktop platforms).

This PR synchronizes the list of modifier keys in keysPressed with the modifier key flags that are present in the raw key event so that they can be relied upon to represent the current state of the keyboard. When synchronizing these states, we don't send any new key events, since they didn't happen when the app had keyboard focus, but if you ask "is this key down", we'll give the right answer
2019-11-06 14:52:55 -08:00
Greg Spencer
0e6cb28dbe
Add fake keyboard key generation to the testing framework (#40706)
There were four or five different implementations in various tests for sendFakeKeyEvent, which roughly all did the same thing. I was going to add yet another one, and decided that it needed to be generalized and centralized. This replaces those instances with something that just takes a LogicalKeyboardKey so that it's self-documenting, and can be used with multiple platforms.

This adds two functions to widget tester: sendKeyDownEvent and sendKeyUpEvent which simulate key up/down from a physical keyboard. It also adds global functions simulateKeyDownEvent and simulateKeyUpEvent that can be called without a widget tester. All are async functions protected by the async guard.
2019-09-24 08:14:38 -07:00