0

Remote number buttons

Hi all,
we are building a widget that uses numeric buttons of the remote control in a fullscreen view.

What we see is that we have a very low response time from when the button is pressed on the remote to the moment thet the event is available to the widget.
In the meanwhile the response time of cursor/function button is much faster.

Is it a known issue or is there a way to shorten the response time of numeric buttons?

Another question: is there a way to intercept numeric buttons in a sidebar view (disabling the TV channel change thay are usually used for)?

Thanks
Stefano

by
5 Replies
  • Hi all,
    does anybody have any suggestion for this issue?

    Here you can see how we detect the remote numeric buttons:

    CODE
    		var pressioneTasto=widget.addEventListener('keydown', function(KFEvent) {
    if (KFEvent.keyCode>=48 && KFEvent.keyCode<=57){
    if (keypress){
    var tasto=KFEvent.keyCode - 49;

    if (tasto>=0 && tasto<9){
    var cella=self.controls.keyboard.getCellDataItem(tasto);

    }else if (tasto==-1){
    var cella=self.controls.keyboard.getCellDataItem(10);
    }

    self._processa(cella);
    keypress=0;

    }else keypress=1;
    }

    is it the right way to do that?

    Thanks
    Stefano
    0
  • Hi,
    I am maiking it this way:
    CODE
    // add key listener in updateView
    this._boundKeyListener = this._keyHandler.subscribeTo(KONtx.application, 'onWidgetKeyPress', this);
    .....
    _keyHandler: function(event) {
    if(event.payload.eventPhase != 3) {
    return;
    }

    var keyCode = event.payload.keyCode;

    if (keyCode >= 49 && keyCode <= 52) {
    // i need only 1-4 keys
    }
    }
    }
    .......
    hideView: function() { // remove key listener in hideView
    if (this._boundKeyListener) {
    this._boundKeyListener.unsubscribeFrom(KONtx.application, 'onWidgetKeyPress');
    this._boundKeyListener = null;
    }
    }


    Cheers, Nikola
    0
  • hello,
    ive been working on handling remote number buttons as well. my question is how can i prevent the onSelect method from being fired when the enter key is pressed under certain circumstances? in my onNavigate code for containers on the screen i use event.preventDefault() to allow me to control where the focus goes instead of however the engine decides, but when i use it as you see down below the onSelect method for my container still gets called. i know i can hack a global variable to do this but thats not fun.......

    _keyHandler: function(event) {
    if(event.payload.eventPhase != 3)
    return;

    var keyCode = event.payload.keyCode;
    log("IM HANDLING: " + keyCode + "!!!!!!!!!!!!!!!!!!");

    if (keyCode == 13 && g.channel_active) {
    event.preventDefault();
    g.channel_active = 0;
    } else if (keyCode >= 48 && keyCode <= 57) {
    g.channel_active = 1;
    }
    }

    thanks,
    dave spangle
    0
  • Hello!

    I've written code that works well on a simulator in a sidebar view. This code take a numeric button and show it in a message box. Here it's:
    CODEBOX
     _keyHandler: function  (event) {
    if(event.payload.eventPhase != 3) {
    return;
    }
    var keyCode = event.payload.keyCode - 48;
    if (keyCode >= 0 && keyCode <= 9)
    {
    this.infoDialog = new KONtx.dialogs.Alert({
    title: "Hi!",
    message: keyCode,
    buttons: [{label: "Ok"}]
    });
    this.infoDialog.show();
    }
    },

    this._keyHandler.subscribeTo(KONtx.application, ['onWidgetKeyPress'], this);


    But it isn't work on Sumsung TV because numeric button used for chanel change. Is there a way to intercept numeric buttons in a sidebar view (disabling the TV channel change thay are usually used for)?
    0
  • I tried the code below...but in my setup I get all keys other than the arrow keys return 0 in my simulator....anyideas<br><br>-rome<br><br><div class="quote"><div class="quotetop">QUOTE<cite>(Sergey Slezko @ 4 May 2010 5:49 AM)</cite></div><blockquote class="quotemain">Hello!<br><br>I&#39;ve written code that works well on a simulator in a sidebar view. This code take a numeric button and show it in a message box. Here it&#39;s:<br><!--c1--><div class="code generic"><div class="codetop">CODEBOX</div><pre class="codemain"><code><!--ec1--> _keyHandler: function (event) {<br> if(event.payload.eventPhase != 3) {<br> return;<br> }<br> var keyCode = event.payload.keyCode - 48;<br> if (keyCode &gt;= 0 &amp;&amp; keyCode &lt;= 9)<br> {<br> this.infoDialog = new KONtx.dialogs.Alert({<br> title: &quot;Hi!&quot;,<br> message: keyCode,<br> buttons: [{label: &quot;Ok&quot;}]<br> });<br> this.infoDialog.show();<br> }<br> },<br> <br>this._keyHandler.subscribeTo(KONtx.application, [&#39;onWidgetKeyPress&#39;], this);<!--c2--></code></pre></div><!--ec2--><br><br>But it isn&#39;t work on Sumsung TV because numeric button used for chanel change. Is there a way to intercept numeric buttons in a sidebar view (disabling the TV channel change thay are usually used for)?</blockquote></div>
    0

Recent Posts

in General - Yahoo! TV Widgets