@@ -47,6 +47,7 @@ public partial class MainWindow
47
47
private MainViewModel _viewModel ;
48
48
private bool _animating ;
49
49
MediaPlayer animationSound = new MediaPlayer ( ) ;
50
+ private bool isArrowKeyPressed = false ;
50
51
51
52
#endregion
52
53
@@ -109,9 +110,11 @@ private async void OnClosing(object sender, CancelEventArgs e)
109
110
private void OnInitialized ( object sender , EventArgs e )
110
111
{
111
112
}
112
-
113
113
private void OnLoaded ( object sender , RoutedEventArgs _ )
114
114
{
115
+ // MouseEventHandler
116
+ PreviewMouseMove += MainPreviewMouseMove ;
117
+
115
118
CheckFirstLaunch ( ) ;
116
119
HideStartup ( ) ;
117
120
// show notify icon when flowlauncher is hidden
@@ -406,6 +409,7 @@ public void WindowAnimator()
406
409
if ( _animating )
407
410
return ;
408
411
412
+ isArrowKeyPressed = true ;
409
413
_animating = true ;
410
414
UpdatePosition ( ) ;
411
415
@@ -494,6 +498,7 @@ public void WindowAnimator()
494
498
windowsb . Completed += ( _ , _ ) => _animating = false ;
495
499
_settings . WindowLeft = Left ;
496
500
_settings . WindowTop = Top ;
501
+ isArrowKeyPressed = false ;
497
502
498
503
if ( QueryTextBox . Text . Length == 0 )
499
504
{
@@ -644,10 +649,12 @@ private void OnKeyDown(object sender, KeyEventArgs e)
644
649
switch ( e . Key )
645
650
{
646
651
case Key . Down :
652
+ isArrowKeyPressed = true ;
647
653
_viewModel . SelectNextItemCommand . Execute ( null ) ;
648
654
e . Handled = true ;
649
655
break ;
650
656
case Key . Up :
657
+ isArrowKeyPressed = true ;
651
658
_viewModel . SelectPrevItemCommand . Execute ( null ) ;
652
659
e . Handled = true ;
653
660
break ;
@@ -698,7 +705,21 @@ private void OnKeyDown(object sender, KeyEventArgs e)
698
705
699
706
}
700
707
}
708
+ private void OnKeyUp ( object sender , KeyEventArgs e )
709
+ {
710
+ if ( e . Key == Key . Up || e . Key == Key . Down )
711
+ {
712
+ isArrowKeyPressed = false ;
713
+ }
714
+ }
701
715
716
+ private void MainPreviewMouseMove ( object sender , System . Windows . Input . MouseEventArgs e )
717
+ {
718
+ if ( isArrowKeyPressed )
719
+ {
720
+ e . Handled = true ; // Ignore Mouse Hover when press Arrowkeys
721
+ }
722
+ }
702
723
public void PreviewReset ( )
703
724
{
704
725
_viewModel . ResetPreview ( ) ;
0 commit comments