Ok, so things don`t seem so straight forward. Using a keytest routine (code below), I catch the 66 keypress (shutter); but using my application I just get zero`s (see below). I really fail to understand why this is happening, any advice would be appreciated.
KEYTEST
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (main) Create, isFirst = false **
** Activity (main) Resume **
Activity_KeyPress(25)
Zoom -
Activity_KeyPress(24)
Zoom +
Activity_KeyPress(11)
Video
Activity_KeyPress(10)
Camera
Activity_KeyPress(66)
Shutter Button clicked
Activity_KeyPress(66)
Shutter Button clicked
Activity_KeyPress(66)
Shutter Button clicked
Activity_KeyPress(66)
Shutter Button clicked
Sub Activity_KeyPress(KeyCode As Int) As Boolean 'Return True to consume the event
If KeyCode = 0 Then Return True
Log($"Activity_KeyPress(${KeyCode})"$)
If KeyCode = 25 Then
Log("Zoom -")
Return True
End If
If KeyCode = 24 Then
Log("Zoom +")
Return True
End If
If KeyCode = 11 Then
Log("Video")
Return True
End If
If KeyCode = 10 Then
Log("Camera")
Return True
End If
If KeyCode = 66 Then
Log("Shutter Button clicked")
Return True
End If
End Sub
SHUTTER APP CODE
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
/storage/emulated/0/Android/data/b4a.example3/files
FULL
** Activity (main) Resume **
Start success: true
25
25
Zoom -
24
Zoom +
10
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Sub Activity_KeyPress (KeyCode As Int) As Boolean
Log (KeyCode)
If KeyCode = 0 Then Return True
If test_flag = -1 Then
Return True
else If test_flag = 1 Then
test_pnl.Visible = False
settings_pnl.Visible = False
test_flag = 0
Return True
End If
If KeyCode = 24 Then
Log("Zoom +")
zoom_val = zoom_val + 1
zoom_bar.Progress = zoom_val * 2
zoom1(zoom_val)
else If KeyCode = 25 Then
Log("Zoom -")
zoom_val = zoom_val - 1
zoom_bar.Progress = zoom_val * 2
zoom1(zoom_val)
else If KeyCode = 66 Then
Log("Shutter")
btnRecord
else If KeyCode = 11 Then
Log("Mode")
btnMode
else If KeyCode = 10 Then
Log("Camera")
btnCamera
End If
End Sub