I can’t believe I don’t find out how this works. In a KeyDown event, I want to check, whether a certain F-Key is pressed. If I write the following code, I get the messageBox:
if asc(key)=8 then
msgbox("enter")
end
But I cannot find the ASCII value for an F-key. I got “keyF5” and the hex-values, but I can’t find out how to address those. Any ideas are appreciated.
I use an app called Key Codes to help me figure out what I’m looking for. It may or may not be able to help with the F-keys and Xojo. https://manytricks.com/keycodes/
be aware, that (as far as my testing shows)… there are certain F-keys on macOS that you CANNOT intercept… the OS takes them long before your app ever sees them…
Hey thanks all for the valuable tips! I am working on a mac. So are you saying, the F-keys might have different values on a mac than on a pc? @Emile Schwarz : your code really helps figuring out the key, thanks. But I sill can find out, how to code the statement to check if my key was pressed. Can anyone direct me here?