I need to capture key presses at the root level without a input element such as TextBox. So, I have a TextBox with Opacity = 0 and I set it to focus whether the user taps the screen (if anyone have a better solution please let me know).
Anyway, everything works fine when I run the app in Intermediate version. I tap the screen and press the keyboard the keypresses are captured. If I switch to final version the keypresses are not captured.
Here is the xaml code:
Code: Select all
<Canvas x:Name="CnvGrid" Background="Green" PointerPressed="CnvGrid_PointerPressed" >
<TextBox x:Name="TbxGrid" TextChanged="TbxGrid_TextChanged" Width="1" Height="1" IsHitTestVisible="False" Opacity="0" />