JazzPiano
New Member
Hi,
Does anyone know how to deal with the Fire tv keys on a webapp that uses webview to navigate through a webpage with touchable images and buttons?
The problem is that when dealing with the Activity_KeyPress() to handle the back button and go back or exit the application:
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
I don't know how to manage the D-Pad keys. I detect them pressed:
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
I think I have to propagate the event to let the webview handle it. But I don't know how.
I had a similar problem due to the use of the Activity_KeyPress Sub with the devices (phones and tables) volume control but I solved as follows:
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
Any idea?
			
			Does anyone know how to deal with the Fire tv keys on a webapp that uses webview to navigate through a webpage with touchable images and buttons?
The problem is that when dealing with the Activity_KeyPress() to handle the back button and go back or exit the application:
			
				Code:
			
		
		
		Sub Activity_KeyPress(KeyCode As Int)
    Dim p As Phone
    Dim handled As Boolean = False
    Select KeyCode
        Case KeyCodes.KEYCODE_BACK
            If myWebViewExtras.CanGoback = True Then
                WebView1.Back
            Else
                Msgbox2Async ("Want to exit?","PitortApp","Yes","","No",Null,True)
                Wait For Msgbox_Result (value As Int)
                If value = DialogResponse.POSITIVE Then
                    WebView1.Visible = False
                    Activity.Finish
                End If
            End IfI don't know how to manage the D-Pad keys. I detect them pressed:
			
				code:
			
		
		
		Case KeyCodes.KEYCODE_DPAD_CENTER
    handled = True
Case KeyCodes.KEYCODE_DPAD_UP
    handled = True
Case KeyCodes.KEYCODE_DPAD_DOWN
    handled = True
Case KeyCodes.KEYCODE_DPAD_LEFT
    handled = True
Case KeyCodes.KEYCODE_DPAD_RIGHT
    handled = TrueI think I have to propagate the event to let the webview handle it. But I don't know how.
I had a similar problem due to the use of the Activity_KeyPress Sub with the devices (phones and tables) volume control but I solved as follows:
			
				code:
			
		
		
		Case KeyCodes.KEYCODE_VOLUME_UP
    p.SetVolume(p.VOLUME_MUSIC, p.GetVolume(p.VOLUME_MUSIC)+1, True)
          
Case KeyCodes.KEYCODE_VOLUME_DOWN
    p.SetVolume(p.VOLUME_MUSIC, p.GetVolume(p.VOLUME_MUSIC)-1, True)Any idea?
 
				 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		