Instead of relying on the modifier key status directly, you can track the state of the modifier keys manually using event handlers.
Here's a general approach you can follow:
Create variables to track the state of the modifier keys. For example, you can use boolean variables like isShiftPressed, isCtrlPressed, and isAltPressed.
Register event handlers for the key events you want to track. In this case, you can register handlers for the KeyDown and KeyUp events.
Inside the KeyDown event handler, check which modifier key was pressed and update the corresponding boolean variable accordingly.
Inside the KeyUp event handler, reset the corresponding boolean variable for the released modifier key.
Now, in your Button.Click event handler, you can check the values of the boolean variables to determine which modifier keys are pressed and trigger the appropriate actions accordingly.
tinaturner335
13 Jun 2024, 20:54 ( Updated at: 17 Jun 2024, 15:02 )
Hello @ undertale yellow,
Instead of relying on the modifier key status directly, you can track the state of the modifier keys manually using event handlers.
Here's a general approach you can follow:
@tinaturner335