语言

Menu
Sites
Language
tizenhwkey event not working after focusing an input from another window

Hello,

I'm trying to open a window from my app, a window which contains a login form. After the input field is selected and the keyboard appears, the tizenhwkey event stops beeing dispatched. Even if the window is closed and I try to reattach the event listener to tizenhwkey, still does not work. Any solution to this? It's a known bug in Tizen?

I have to mention that I tried to listen for the tizenhwkey event in the opened window and it works until the keyboard is shown, after that, the event stops beeing dispatched.

 

编辑者为: Cristian Loloiu 29 10月, 2013

响应

7 回复
Lakshmi Grandhi

Hi,

Its a known issue, once you open any external url from <a href="google.com"/> or window.open("www.google.com") hardware key events wont work, hardware key events works only for app widget html pages.

Cristian Loloiu

And there is no fix for this?

Lakshmi Grandhi

Hi,

 

I have raise bug in JIRA https://bugs.tizen.org/jira/browse/TDIST-596, follow it for updates.

Alexander AVSukhov

Hello,

Could you provide your code for opening the window?

If you open external url as described by Lakshmi Grandhi it is issue and it will be fixed in future release.

For the opening of external resources you can use iframe or default browser (appControl).

Cristian Loloiu

Yes.

function openMyWin()
{
    var serviceURL = 'https://oauth.vk.com/authorize?client_id=...';
    window.oauthWin = window.open(serviceURL, "_blank", "", false);

    //check to see if oauthWin window is closed and reattach event handler for hw buttons
    window.closedtimer =  self.setInterval(function ()
		{
			if(window.oauthWin.closed)
				{
					window.clearInterval(closedtimer);
					$(document).bind('tizenhwkey', listenHWKey) //does not work
				}
		}, 500);
    listenForURLChange();               
}

function listenForURLChange()
{
    window.intTimer = self.setInterval(function () 
    	{
    		if (window.oauthWin && window.oauthWin.location) 
    			{
        			var currentURL = window.authWin.location.href;
        			console.log('Current URL: ' + currentURL);
        			
                    //inject js script into oauthWin to listen for hw buttons... works until input is focused and keyboard appears 
                    /*if(window.authWin.document.getElementById('myCodeHere')) 
                    { 
                        //code alreade injected
                    }
            		else
                    {
                        //inject code
        			    $(window.authWin.document.body).append('<div id="myCodeHere"> <script>  ... code here ...  </script> </div>');
                    }    
                    */
                    
        			var inSuccess  = currentURL.indexOf('#acces_token');
        			var isError = currentURL.indexOf('#error');
                    
        			if (isError >= 0)
        				{
        					window.clearInterval(intTimer)
        					window.oauthWin.close();
        					alert('error');
        				}
        			if (isSuccess >= 0) 
        				{
            				window.clearInterval(intTimer)
            				window.oauthWin.close();
            				alert('auth ok');
        				}
    			}
        }, 500);
}

 

Cristian Loloiu

A few typos there, instead of window.authWin is window.oauthWin

Cristian Loloiu

Sample project: https://dl.dropboxusercontent.com/u/46032438/keyboardbug.zip