@@ -227,7 +227,7 @@ private void DataGrid_GotFocus(object sender, RoutedEventArgs e)
227
227
statusSearch = Search . Assign ;
228
228
Label_AssgnStatus . Content = "AWAITING INPUTS" ;
229
229
}
230
-
230
+
231
231
private void KeyMappingGrid_MouseRightButtonDown ( object sender , MouseButtonEventArgs e )
232
232
{
233
233
KeyMappingGrid . UnselectAllCells ( ) ;
@@ -383,8 +383,12 @@ public void JumptoAssignedKey()
383
383
384
384
private void KeyMappingGrid_KeyDown ( )
385
385
{
386
- KeyMappingGrid . ScrollIntoView ( KeyMappingGrid . Items [ currentIndex ] ) ;
387
- KeyMappingGrid . SelectedIndex = currentIndex ;
386
+ if ( currentIndex < 0 )
387
+ {
388
+ currentIndex = 1 ;
389
+ statusSearch = Search . Search ;
390
+ return ;
391
+ }
388
392
if ( SearchBox . IsSelectionActive == true )
389
393
return ;
390
394
if ( SearchBox . IsFocused == true )
@@ -400,9 +404,6 @@ private void KeyMappingGrid_KeyDown()
400
404
401
405
directInputDevice . GetCurrentKeyboardState ( ) ;
402
406
403
- //if (directInputDevice.KeyboardState[(Microsoft.DirectX.DirectInput.Key)211])
404
- // Console.WriteLine("delete!");
405
-
406
407
for ( int i = 1 ; i < 238 ; i ++ )
407
408
{
408
409
if ( directInputDevice . KeyboardState [ ( Microsoft . DirectX . DirectInput . Key ) i ] )
@@ -457,6 +458,8 @@ private void KeyMappingGrid_KeyDown()
457
458
if ( Select_PinkyShift . IsChecked == false )
458
459
pinkyStatus = Pinky . Shift ;
459
460
461
+ KeyMappingGrid . ScrollIntoView ( KeyMappingGrid . Items [ currentIndex ] ) ;
462
+ KeyMappingGrid . SelectedIndex = currentIndex ;
460
463
if ( pinkyStatus == Pinky . UnShift )
461
464
keyAssign [ currentIndex ] . SetKeyboard ( catchedScanCode , Shift , Ctrl , Alt ) ;
462
465
if ( pinkyStatus == Pinky . Shift )
0 commit comments