:sign0013:,I not make it clearly: some buttons(keypad) on the headset ,how to use the headset button to control MyApp,so need read the message from headset.
:sign0013:,I not make it clearly: some buttons(keypad) on the headset ,how to use the headset button to control MyApp,so need read the message from headset.
Try with the forms keypress to see if it receives the keycode.
B4X:
Sub Form1_Keypress(key)
msgbox(key)
End Sub
If that doesn't work try with the door library
B4X:
Sub App_Start
door.New1(false)
door.FromControl("Form1")
door.SetProperty("KeyPreview", true)
event.New1(door.Value, "KeyDown")
End Sub
Sub event_NewEvent
door.Value = event.Data
msgbox(dooor.GetValue("KeyCode"))
End Sub
If it still won't work, an external libray would have to be written with an SDK from the phones manufacturer.
I've been trying to get the keycodes using a Keyboard Hook.
Unfortunately it's not working for me.
It prevents all key presses and, if the keycode is known, will allow a key press.