incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joe Bowser (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (CB-417) D-pad events not firing in Google TV
Date Tue, 18 Sep 2012 23:27:07 GMT

     [ https://issues.apache.org/jira/browse/CB-417?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Joe Bowser resolved CB-417.
---------------------------

    Resolution: Duplicate

Superceded by CB-913
                
> D-pad events not firing in Google TV
> ------------------------------------
>
>                 Key: CB-417
>                 URL: https://issues.apache.org/jira/browse/CB-417
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 1.4.0, 1.5.0
>         Environment: Eclipse on Linux with Google TV add-on, Phonegap 1.5 & 1.4 (only
tested these versions)
>            Reporter: Hugo De Zela
>            Assignee: Joe Bowser
>            Priority: Minor
>              Labels: google, tv
>
> Any Javascript calls to D-pad events or special button events (Play, FFW, etc...) don't
fire in Phonegap.
> Have tried: keypress, keydown, keyup.
> However, if I register an override in the main js file like this:
> [code]
> @Override
>     public boolean onKeyDown(int keyCode, KeyEvent event) {
>         WebView myWebView = (WebView) findViewById(R.id.webview);
>         if (keyCode == KeyEvent.KEYCODE_DPAD_UP) { myWebView.loadUrl("javascript:daleTecla('UP');");
return true; }
>         if (keyCode == KeyEvent.KEYCODE_DPAD_DOWN) { myWebView.loadUrl("javascript:daleTecla('DOWN');");
return true; }
>         if (keyCode == KeyEvent.KEYCODE_DPAD_LEFT) { myWebView.loadUrl("javascript:daleTecla('LEFT');");
return true; }
>         if (keyCode == KeyEvent.KEYCODE_DPAD_RIGHT) { myWebView.loadUrl("javascript:daleTecla('RIGHT');");
return true; }
>         if (keyCode == KeyEvent.KEYCODE_ENTER || keyCode == KeyEvent.KEYCODE_DPAD_CENTER)
{ myWebView.loadUrl("javascript:daleTecla('ENTER');"); return true; }
>         if (keyCode == KeyEvent.KEYCODE_MEDIA_PLAY || keyCode == KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE)
{ myWebView.loadUrl("javascript:daleTecla('PLAYPAUSE');"); return true; }
>         if (keyCode == KeyEvent.KEYCODE_MEDIA_NEXT) { myWebView.loadUrl("javascript:daleTecla('NEXT');");
return true; }
>         if (keyCode == KeyEvent.KEYCODE_MEDIA_PREVIOUS) { myWebView.loadUrl("javascript:daleTecla('PREV');");
return true; }
>         if (keyCode == KeyEvent.KEYCODE_MEDIA_FAST_FORWARD) { myWebView.loadUrl("javascript:daleTecla('FFW');");
return true; }
>         if (keyCode == KeyEvent.KEYCODE_MEDIA_REWIND) { myWebView.loadUrl("javascript:daleTecla('REW');");
return true; }
>         if (keyCode == KeyEvent.KEYCODE_MEDIA_STOP) { myWebView.loadUrl("javascript:daleTecla('STOP');");
return true; }
>         if (keyCode == KeyEvent.KEYCODE_MENU) { myWebView.loadUrl("javascript:daleTecla('MENU');");
return true; }
>         return super.onKeyDown(keyCode, event);
>     }
> [/code]
> The javascript "daleTecla" (my keypress handler), receives all except KEYCODE_DPAD_LEFT.
Sometimes, but only AFTER DPAD_RIGHT is called, DPAD_LEFT fires, this is not consistent behavior
though.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message