You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Keyboard events should be implemented on iOS #31945
It seems there is more blocking this than the simple matter of implementing it in the engine.
I gather that iOS does not actually expose key-level events in its public API. Flutter would only have "insertText" and "deleteBackward" and "UIKeyCommand" events to work with, and mapping those back to the USB keypresses that generated them is not feasible.
Maybe the situation is different on iOS 13 (but probably not by much). At the very least, from the comments on this WebKit bug, it sounds like a best-effort implementation could handle e.g. arrow keys on iOS 13, but not earlier versions. I certainly don't see the full picture of how close to an implementation of RawKeyboardEvent for iOS it's possible to get, but it seems the answer is "not very close". (I see no way to detect keydown vs. keyup, for example, as one might need for e.g. games that use WASD keys for movement.)
It seems there is more blocking this than the simple matter of implementing it in the engine.
I gather that iOS does not actually expose key-level events in its public API. Flutter would only have "insertText" and "deleteBackward" and "UIKeyCommand" events to work with, and mapping those back to the USB keypresses that generated them is not feasible.
Maybe the situation is different on iOS 13 (but probably not by much). At the very least, from the comments on this WebKit bug, it sounds like a best-effort implementation could handle e.g. arrow keys on iOS 13, but not earlier versions. I certainly don't see the full picture of how close to an implementation of RawKeyboardEvent for iOS it's possible to get, but it seems the answer is "not very close". (I see no way to detect keydown vs. keyup, for example, as one might need for e.g. games that use WASD keys for movement.)
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
lynn commentedon Oct 4, 2019
Since I was confused here: that's #8606 on
flutter/engine, not this repo.It seems there is more blocking this than the simple matter of implementing it in the engine.
I gather that iOS does not actually expose key-level events in its public API. Flutter would only have "insertText" and "deleteBackward" and "UIKeyCommand" events to work with, and mapping those back to the USB keypresses that generated them is not feasible.
Maybe the situation is different on iOS 13 (but probably not by much). At the very least, from the comments on this WebKit bug, it sounds like a best-effort implementation could handle e.g. arrow keys on iOS 13, but not earlier versions. I certainly don't see the full picture of how close to an implementation of RawKeyboardEvent for iOS it's possible to get, but it seems the answer is "not very close". (I see no way to detect keydown vs. keyup, for example, as one might need for e.g. games that use WASD keys for movement.)
[-]Raw Keyboard Events should be implemented on iOS[/-][+]Keyboard events should be implemented on iOS[/+]jmagman commentedon Mar 19, 2020
iPadOS 13.4 (March 24 release) emphasized magic keyboard/trackpad support for 2018 iPad Pro, more users may be hitting this.
kaarme01 commentedon Apr 27, 2020
https://developer.apple.com/documentation/uikit/mac_catalyst/handling_key_presses_made_on_a_physical_keyboard
?
dgurudot commentedon Jun 9, 2020
Any updates on it ? iOS allows external bluetooth keyboard to be connected so is it possible to detect keyboard key presses ?
One of my app needs to detect shortcuts like Shift+1, or Ctrl-Z etc and looking for solutions.
nilsreichardt commentedon Jun 27, 2020
Is macOS also effected from this issue?
gspencergoog commentedon Jun 28, 2020
No, macOS has keyboard support.
incon commentedon Aug 19, 2020
Possible solution for iOS?
https://developer.apple.com/documentation/uikit/uipress/3526315-key
lynn commentedon Aug 19, 2020
Yes, we have solved this with a platform channel and
UIKeyin our project.github-actions commentedon Aug 10, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.