Press event handler not getting mkAlt in ModifiersDown?

I am trying to see if Alt key is pressed in my main TViewPlay.Press(const Event: TInputPressRelease) but mkAlt is never in Event.ModifiersDown no matter what I do. mkCtrl does work. What am I missing?

Assuming you are on Windows: There is indeed an issue with us not being able to perfectly detect Alt key presses, due to it being intercepted early by Windows. There’s a TODO on castle-engine/src/window/windows/ at master · castle-engine/castle-engine · GitHub .

I could look into it more, though I remember I tried to fight with it in the past and lost – i.e. Windows refuses to just tell us about Alt key events without interfering.

The other keys, including Ctrl and Shift, indeed don’t have any problem.

I can use ctrl. Too many more important things.

1 Like