is that the correct way to handle cursor up and down keys?
what about mac os? have xojo key constants?
[code]Function KeyDown(Key As String) Handles KeyDown as Boolean
Var DeltaY As Integer = 3.0
Select Case Key
Case Encodings.ASCII.Chr(30)
ScrollOffsetY = -DeltaY * 10.0
Case Encodings.ASCII.Chr(31)
ScrollOffsetY = DeltaY * 10.0
End Select
If Keyboard.AsyncKeyDown(125) Then
// do something with the down arrow key...
End If
If Keyboard.AsyncKeyDown(126) Then
// do something with the Up arrow key...
End If
or you can pass keys in hex: If Keyboard.AsyncKeyDown(&h7D) Then ’ down arrow
I believe this will work for Windows and MacOs.
I believe that only a few keys have been defined in XOJO (eg: alt, ctrl, shift, option) as a readonly property of the keyboard object. see: Keyboard — Xojo documentation
@Craig Hyde Don’t use Keyboard.Asynckeydown in the KeyDown event. Always use the Key parameter passed to you. The example code in the docs would be appropriate to use in a Timer.