Topics

Forum Topics not found

Replies

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:

  1. Create variables to track the state of the modifier keys. For example, you can use boolean variables like isShiftPressed, isCtrlPressed, and isAltPressed.
  2. Register event handlers for the key events you want to track. In this case, you can register handlers for the KeyDown and KeyUp events.
  3. Inside the KeyDown event handler, check which modifier key was pressed and update the corresponding boolean variable accordingly.
  4. Inside the KeyUp event handler, reset the corresponding boolean variable for the released modifier key.
  5. 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