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
[Android] TextBox.KeyDown event is not working #13983
difficulty/medium 🤔Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUIhas-repro-branchkind/regressionSomething was working, now it isn'tproject/input ⌨️Categorizes an issue or PR as relevant to input (Button, CheckBox, Toggle, Scroll, Map, Numeric,...)project/keyboard ⌨️Categories and issue or PR as relevant to keyboard input or keyboard accelerators.triage/potentially-fixedCategorizes an issue as potentially fixed by some unlinked PR, fix needs to be verified
Thanks for the report. It is likely that the KeyDown event is not propagated (and may not be able to) because the native TextBox is handling it for itself.
@jeromelaban Yes it did, I can confirm it soon, I'll go back to a previous version of the project and tell you which Uno version it was. But if it's related to the device itself it might not work in previous versions either. I'll update you in 15 minutes.
@jeromelaban Doesn't work anymore on previous version, looks like it's the device. I was able to reproduce on Pixel 3 emulators too. Might be a Pixel thing.
As soft input methods can use multiple and inventive ways of inputting text, there is no guarantee that any key press on a soft keyboard will generate a key event: this is left to the IME's discretion, and in fact sending such events is discouraged. You should never rely on receiving KeyEvents for any key on a soft input method. In particular, the default software keyboard will never send any key event to any application targetting Jelly Bean or later, and will only send events for some presses of the delete and return keys to applications targetting Ice Cream Sandwich or earlier. Be aware that other software input methods may never send key events regardless of the version. Consider using editor actions like EditorInfo.IME_ACTION_DONE if you need specific interaction with the software keyboard, as it gives more visibility to the user as to how your application will react to key presses
Note: When handling keyboard events with the KeyEvent class and related APIs, expect that the keyboard events are coming only from a hardware keyboard. Never rely on receiving key events for any key on a soft input method (an on-screen keyboard).
There doesn't seem to be a way for us to reliably detect input from soft keyboard. This feels like a platform limitation that we can't do anything about.
Hey there — just a heads-up that this issue has been quiet for over a year. If there’s no update or comment in the next 10 days, it’ll be closed automatically. Feel free to remove the stale label or drop a note to keep it open.
⚠️ The test(s) pass on Skia targets. The issue reports the bug on Android (Google Pixel 6), which is a native target not covered by the Skia runtime test runner. This bug is likely native-target-specific and may not reproduce on Skia. A PR has been created to add the passing test(s) as regression coverage.
Note: The tests use OnKeyTestingOnly which bypasses the virtual keyboard (IME) layer. The actual Android bug may be in the IME event routing path, which requires device-level testing to verify.
difficulty/medium 🤔Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUIhas-repro-branchkind/regressionSomething was working, now it isn'tproject/input ⌨️Categorizes an issue or PR as relevant to input (Button, CheckBox, Toggle, Scroll, Map, Numeric,...)project/keyboard ⌨️Categories and issue or PR as relevant to keyboard input or keyboard accelerators.triage/potentially-fixedCategorizes an issue as potentially fixed by some unlinked PR, fix needs to be verified
Activity
jeromelaban commentedon Oct 16, 2023
Thanks for the report. It is likely that the KeyDown event is not propagated (and may not be able to) because the native TextBox is handling it for itself.
Is it something that worked before?
Soap-141 commentedon Oct 16, 2023
@jeromelaban Yes it did, I can confirm it soon, I'll go back to a previous version of the project and tell you which Uno version it was. But if it's related to the device itself it might not work in previous versions either. I'll update you in 15 minutes.
Soap-141 commentedon Oct 16, 2023
@jeromelaban Doesn't work anymore on previous version, looks like it's the device. I was able to reproduce on Pixel 3 emulators too. Might be a Pixel thing.
[-][Android] TextBox KeyDown event is not working[/-][+][Android] `TextBox.KeyDown` event is not working[/+]Youssef1313 commentedon Oct 25, 2023
https://developer.android.com/reference/android/view/KeyEvent.html
https://developer.android.com/develop/ui/views/touch-and-input/keyboard-input/commands
There doesn't seem to be a way for us to reliably detect input from soft keyboard. This feels like a platform limitation that we can't do anything about.
github-actions commentedon Dec 27, 2025
Hey there — just a heads-up that this issue has been quiet for over a year. If there’s no update or comment in the next 10 days, it’ll be closed automatically. Feel free to remove the stale label or drop a note to keep it open.
test: Reproduce TextBox KeyDown event not firing on Android
MartinZikmund commentedon Apr 20, 2026
Repro generator
Runtime test(s) added in branch
dev/mazi/repro/13983:src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_TextBox.cs→When_TextBox_Focused_And_Key_Pressed_Then_KeyDown_Firessrc/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/Given_TextBox.cs→When_TextBox_Focused_And_Enter_Pressed_Then_KeyDown_FiresNote: The tests use
OnKeyTestingOnlywhich bypasses the virtual keyboard (IME) layer. The actual Android bug may be in the IME event routing path, which requires device-level testing to verify.test: Reproduce TextBox KeyDown event not firing on Android