Sub Activity_KeyPress(KeyCode As Int) As Boolean
Dim temp As Int
'Intercetta il volume e lo regola
Select KeyCode
Case KeyCodes.KEYCODE_VOLUME_DOWN
temp = Main.Phone1.GetVolume(Main.Phone1.VOLUME_MUSIC)
If temp > 0 Then temp = temp - 1 Else temp = 0
Main.Phone1.SetVolume(Main.Phone1.VOLUME_MUSIC, temp, True)
Return True
Case KeyCodes.KEYCODE_VOLUME_UP
temp = Main.Phone1.GetVolume(Main.Phone1.VOLUME_MUSIC)
If temp < Main.Phone1.GetMaxVolume(Main.Phone1.VOLUME_MUSIC) Then
temp = temp + 1
Else
temp = Main.Phone1.GetMaxVolume(Main.Phone1.VOLUME_MUSIC)
End If
Main.Phone1.SetVolume(Main.Phone1.VOLUME_MUSIC, temp, True)
Return True
End Select
End If
Return True
End Sub