incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hugo De Zela (Created) (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CB-417) D-pad events not firing in Google TV
Date Sat, 31 Mar 2012 06:18:40 GMT
D-pad events not firing in Google TV
------------------------------------

                 Key: CB-417
                 URL: https://issues.apache.org/jira/browse/CB-417
             Project: Apache Callback
          Issue Type: Bug
          Components: Android
    Affects Versions: 1.5.0, 1.4.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


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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message