From 5931b1476bbb0cf26aed54415e01a9fc8ec10f42 Mon Sep 17 00:00:00 2001 From: Pilzinsel64 Date: Mon, 23 Oct 2023 12:30:05 +0200 Subject: [PATCH] fix checks for key down & up --- Pilz.UI/PaintingControl/PaintingControl.vb | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Pilz.UI/PaintingControl/PaintingControl.vb b/Pilz.UI/PaintingControl/PaintingControl.vb index e1a7890..669815f 100644 --- a/Pilz.UI/PaintingControl/PaintingControl.vb +++ b/Pilz.UI/PaintingControl/PaintingControl.vb @@ -129,10 +129,16 @@ Public Class PaintingControl Refresh() End Sub - Private Sub CheckKeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown, Me.KeyUp - pressedShift = e.Shift - pressedControl = e.Control - pressedAlt = e.Alt + Private Sub CheckKeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown + If e.Shift Then pressedShift = True + If e.Control Then pressedControl = True + If e.Alt Then pressedAlt = True + End Sub + + Private Sub CheckKeyUp(sender As Object, e As KeyEventArgs) Handles Me.KeyUp + If e.Shift Then pressedShift = False + If e.Control Then pressedControl = False + If e.Alt Then pressedAlt = False End Sub Friend ReadOnly Property AreaSelectionRectangle As RectangleF