KeyEventArgs Shift + TAB

1.6k Views Asked by At

I'd like to create the KeyEvent "SHIFT + TAB" using this method for navigation. How can I set the Shift Key as Modifier?

Dim args As New System.Windows.Input.KeyEventArgs(Keyboard.PrimaryDevice, Keyboard.PrimaryDevice.ActiveSource, 0, Key.Tab)
args.RoutedEvent = Keyboard.KeyDownEvent
InputManager.Current.ProcessInput(args)

Thanks!

2

There are 2 best solutions below

0
BirnBaumBlüte On BEST ANSWER

What worked for me was that I had to override the ProvideCommandsForKey function of the DefaultKeyboardCommandProvider to create the List of commands that Shift + Tab would do.

http://docs.telerik.com/devtools/wpf/controls/radgridview/commands/KeyboardCommandProvider

5
MarcoR On

Try this:

if (args.KeyboardDevice.Modifiers == ModifierKeys.Shift)
{
     if (args.Key == Key.Tab)
     { }
}

Hope it will work.