fix(zoom): ignore Ctrl auto-repeat — the box was closing itself as it was created
Creation holds Ctrl (Ctrl+right-click), and Windows repeats a held modifier. The repeat tick landed after the box existed, so the dismiss handler saw an open box and closed it: appear, then vanish ~500ms later. Guarded with e.IsRepeat, which only ever skips the repeat events — a genuine second press still closes the box.
This commit is contained in:
@@ -171,6 +171,11 @@ public partial class MainWindow : Window
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void MainWindow_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
|
private void MainWindow_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
|
||||||
{
|
{
|
||||||
|
// ⛔ e.IsRepeat matters: Windows auto-repeats a held modifier. Creation holds Ctrl (the
|
||||||
|
// chord is Ctrl+right-click), so without this guard the repeat tick ~500 ms later saw an
|
||||||
|
// open box and closed it — the box appeared and vanished as it was created.
|
||||||
|
if (e.IsRepeat) return;
|
||||||
|
|
||||||
if (e.Key is System.Windows.Input.Key.LeftCtrl or System.Windows.Input.Key.RightCtrl
|
if (e.Key is System.Windows.Input.Key.LeftCtrl or System.Windows.Input.Key.RightCtrl
|
||||||
&& _viewModel.IsZoomActive)
|
&& _viewModel.IsZoomActive)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user