Keypress Event

Develop and Deploy Cross-Browser Web Apps .

Keypress Event

Postby joedarock » Wed Aug 10, 2016 3:05 pm

Is there an event that fires whenever any keyboard key is pressed, unrelated to any UI element? Can you show an example of how to include the code and how to read the value of the key that was pressed?

Thanks
joedarock
 
Posts: 159
Joined: Thu Nov 19, 2015 8:39 pm

Re: Keypress Event

Postby support » Mon Aug 29, 2016 7:29 am

   
Class('App', 'xui.Module',{
Instance:{
iniComponents : function(){
// [[Code created by CrossUI RAD Studio
var host=this, children=[], append=function(child){children.push(child.get(0));};

return children;
// ]]Code created by CrossUI RAD Studio
},
events:{onReady:"_onready"},
_onready:function(){

//code
xui.doc.onKeypress(function(p,e){
xui.echo("Your pressed - "+xui.Event.getKey(e).key);
});
}
}
});
   
support
 
Posts: 342
Joined: Sat Apr 27, 2013 9:22 am


Return to CrossUI for Web Apps

Who is online

Users browsing this forum: No registered users and 1 guest

cron