Thanks, this makes sense.
I’ve implemented this for the next release: https://feedback.objo.dev/feature/457
Keyboard now works during mouse/pointer events such as MouseDown(), MouseUp(), MouseMove(), MouseDrag(), MouseWheel(), MouseEnter(), and MouseExit().
The main intended use is:
# E.g. in a `Canvas.MouseDrag()` event
If Keyboard.ShiftDown Then
# Constrain movement, extend selection, etc.
End If
End Sub
The aggregate modifier properties are the reliable way to use this in mouse handlers:
Keyboard.ShiftDown
Keyboard.ControlDown
Keyboard.AltDown
Keyboard.CommandDown
Physical left/right checks such as Keyboard.IsKeyDown(Key.LeftShift) are still best effort during mouse events. They work if the app has already seen that physical key go down, but mouse events from the OS usually only report aggregate modifier state.