I note that when I test my app with the computer keyboard and emulator, i get keycodes that don't appear to be ascii compliant. i.e. the "5" key generates a keycode of 12 instead of the Ascii code 53. Is this something associated with the emulator and having a keyboard attached? When the app is installed on a device, will these codes be consistent or will the keycodes be Ascii?
Is there a formula so we can convert the keycodes to the appropriate ascii codes? I'm integrating a handheld barcode scanner and I need to map the keys to the appropriate values. btw, the help doesn't say what value each keycode is.
Thank you for the info. So without doing a select case for every possible keycode is there a function such as chr() that can map the keycode to a character?
Sub Activity_KeyPress (KeyCode As Int) As Boolean 'Return True to consume the event
Dim s As String = ""
If KeyCode >= KeyCodes.KEYCODE_0 AND KeyCode <= KeyCodes.KEYCODE_9 Then
s = Chr(KeyCode + 41)
Else If KeyCode >= KeyCodes.KEYCODE_A AND KeyCode <= KeyCodes.KEYCODE_Z Then
s = Chr(KeyCode + 36)
End If
If s <> "" Then
Log(s)
Return True
End If
End Sub