I surely must be doing something awfully wrong. But what?
This piece of code in a button press handler
If Keyboard.AltKey Or Keyboard.OptionKey Or Keyboard.ControlKey Then
Break
Else
ConnectButton.Enabled = True
ConnectButton.Press
End If
will break into the debugger on macOS once one of the keys is held.
It will trigger the button press on Windows, no matter what. I used to use the Async methods but that did not work as well.
I’m not able to reproduce your results on Windows 11 using the latest Xojo build.
What version of Xojo are you using? What version of Windows? Is this inside a VM?
Sample project: keys.xojo_xml_project (3.5 KB)
This works for me too, with Xojo 2025r1.1 on a MacBook and a Parallels Windows 10 VM as target.
This does not influence the fact that the keys are not working as expected in this app. They are in a different one.
Just found this.
EDIT: As a mitigation, AsyncKeyDown(hex) does work. So I’ll add a space depress as fallback.
VMs, Parallels especially, screw with the keys. There’s nothing for Xojo to fix, it’s a problem with Parallels.
Here’s a recent ticket about these keys where the user finds the VM is the problem:
#79147 - Keyboard methods for Ctrl, Shift and Alt keys (sync and async versions) aren’t updated while the user does nothing.
1 Like
Try this in Parallels:
Ignore the apps being called “games”.
1 Like
Thanks! That was the setting I would not have expected to be suitable for my purposes 
1 Like