-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi all,
I defined the function shown below, with the intention of capturing a series of keys, but only enters the event when I press ctrl + e, does not fall for any of the other cases. (F5, Up & Down)
oInputElement.setCtrlKeys("^e#f5#up#down");
oInputElement.addEventListener("onCtrlKey", new org.zkoss.zk.ui.event.EventListener() {
public void onEvent(Event event) throws Exception {
if (((KeyEvent)event).getKeyCode() == 69){
(ctrl + e)
....
}else if (((KeyEvent)event).getKeyCode() == 40) {
(dowm)
....
}else if (((KeyEvent)event).getKeyCode() == 38) {
(up)
....
}else if (((KeyEvent)event).getKeyCode() == 116) {
(f5)
....
}
}
});
Thanks,
Hi, softteam
I try this sample
it works well
<zk> <textbox id="tb" ctrlKeys="^e#f5#up#down"> <attribute name="onCtrlKey"><![CDATA[ int keyCode = ((KeyEvent) event).getKeyCode(); switch(keyCode){ case 69: alert("Ctrl + e");break; case 40: alert("down");break; case 38: alert("up");break; case 116: alert("f5");break; } ]]></attribute> </textbox> </zk>
Hi as1225,
True if it works, I have tried on a new project and works well. The problem is when I put it in another project I'm working, which only comes when ctrl + e. I tried also on another project and work correctly all but the f5, it only works for firefox. I will investigate about it.
Thank you.
Hi silicon
You can post the bug in the following url
http://tracker.zkoss.org/secure/Dashboard.jspa
Asked: 2010-02-17 10:57:04 +0800
Seen: 1,073 times
Last updated: Jan 31 '13