I've read carefully the following links: https://msdn.microsoft.com/en-us/library/system.windows.forms.control.previewkeydown.aspx and here: enter link description here I am NOT (and cannot use) "System.Windows.Forms". I AM using "System.Windows.Input".
I can't seem to find where I can capture the arrow key KeyDown or KeyUp events from a standard USA keyboard.
Here's an example of the xaml code I'm using:
<ContentControl Width="800"
Height="30"
x:Name="cc_InputBox"
Canvas.Left="10"
Canvas.Top="698"
Style="{StaticResource DesignerItemStyle}">
<Grid>
<Border IsHitTestVisible="False" Background="Gray" />
<Border Margin="0,0,10,0">
<TextBox
x:Name="inputBox"
KeyDown="inputBox_KeyDown"
TextWrapping="Wrap"
Focusable="True"
/>
</Border>
</Grid>
And here's my .cs code (that's not picking up arrow keys):
private void inputBox_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
{
if (e.Key == Key.Up)
{
// do stuff
}
}
All the stuff I can find is always in reference to "Forms" and can't find anything with "Input"