0

how get keyboard event

asked 2009-03-23 07:41:27 +0800

sanhaq gravatar image sanhaq
264 1 6

Hi,
Is there any ZK tag to capture keyboard event.
Actually I have added one button and I want to press/click the button by pressing the enter/return key from keyborad only not by by mouse. And I want to call method like onClick for that keyboard event.
Please help.

delete flag offensive retag edit

13 Replies

Sort by ยป oldest newest

answered 2009-03-23 08:36:16 +0800

hideokidd gravatar image hideokidd
750 1 2

Hi,

please see developer's guide
http://docs.zkoss.org/wiki/Component_Events#The_ctrlKeys_Property
and example here
http://www.zkoss.org/zkdemo/userguide/#e7

Thanks

link publish delete flag offensive edit

answered 2009-03-23 09:39:41 +0800

sanhaq gravatar image sanhaq
264 1 6

Thanks a lot.

link publish delete flag offensive edit

answered 2010-08-05 08:27:33 +0800

moloch gravatar image moloch
606 1 13

hello, but when i want to close my modal window from my composer class it dont work for me
please tell me how to do this.

my zul:


<window title=" " 
		apply="com.composer.myComposer" 
		id="myWindow" closable="true" onCtrlKey="doCtrlKey()">


in the composer:

	void doCtrlKey() {
		myWindow.onClose();
	}

link publish delete flag offensive edit

answered 2010-08-05 10:36:41 +0800

twiegand gravatar image twiegand
1807 3

Moloch,

Perhaps you could try:

myWindow.detach();

Regards.

link publish delete flag offensive edit

answered 2010-08-16 02:42:21 +0800

moloch gravatar image moloch
606 1 13

hello, the problem is not the onClose method i would say. the problem is that i didn t come into the method "void doCtrlKey()"
what is wrong?

link publish delete flag offensive edit

answered 2010-08-16 09:15:16 +0800

Arsen gravatar image Arsen
384 5

Good day, moloch.
Try this way

<window title=" " 
		apply="com.composer.myComposer" 
		id="myWindow" closable="true">

and composer

	public void doCtrlKey$myWindow() {
		myWindow.detach();
	}

link publish delete flag offensive edit

answered 2010-08-17 06:09:01 +0800

moloch gravatar image moloch
606 1 13

hello, it does not work for me. i set a breakpoint on line myWindow.detach() but nothing invoke this line!
what is wrong?

link publish delete flag offensive edit

answered 2010-08-18 04:21:14 +0800

RyanWu gravatar image RyanWu
533 2
about.me/flyworld

@moloch
could you please provide your code ?
i think it might have some misunderstand in it.

link publish delete flag offensive edit

answered 2010-08-18 07:37:51 +0800

moloch gravatar image moloch
606 1 13

but you see my code here!? i post it.

link publish delete flag offensive edit

answered 2010-08-20 07:42:26 +0800

RyanWu gravatar image RyanWu
533 2
about.me/flyworld

onCtrlKey

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2009-03-23 07:41:27 +0800

Seen: 717 times

Last updated: Aug 24 '10

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More