0

Get Key events

asked 2008-10-03 08:29:50 +0800

memaster gravatar image memaster
66 2

Hello,
I want to catch key events (space bar press, esc, enter, ...) in ZK. On the whole page.
Is this possible?

Thanks Martin

delete flag offensive retag edit

9 Replies

Sort by ยป oldest newest

answered 2008-10-03 09:17:21 +0800

PeterKuo gravatar image PeterKuo
481 2

U can catch certain key events in <window>.
Please ref the developer's guide, search "The ctrlKeys Property".this

And U can "Add and Remove Event Listeners to Pages Dynamically", also in developer's guide.
"...
all events of the specified name the are sent to any components of the specified page will be sent to the listener.
..."

Wish above information can help U.

link publish delete flag offensive edit

answered 2008-10-03 13:05:39 +0800

memaster gravatar image memaster
66 2

Hello
thanks or this hint. This sound good.
I wrote this code but nothing happens. What is wrong?

<window title="My First Window" border="normal" width="200px" ctrlKeys="#del" onCtrlKey="alert("Del pressed!");">
Hello, World!
</window>

link publish delete flag offensive edit

answered 2008-10-03 13:39:01 +0800

robertpic71 gravatar image robertpic71
1275 1

Keyboard events are only possible on input elements.

Try this example.

<window id="win" title="My First Window" border="normal" width="200px" ctrlKeys="#del" onCtrlKey="alert("Del pressed!");">
<label value="Hello, World!"/>
<textbox id="input"/>
<zscript>
          input.focus();
</zscript>
</window>	

/Robert

link publish delete flag offensive edit

answered 2008-10-03 14:51:25 +0800

memaster gravatar image memaster
66 2

That's working. How can I get the key press event of he space bar? Do I need to get this form the textbox or is there an other way?

link publish delete flag offensive edit

answered 2008-10-06 11:34:32 +0800

memaster gravatar image memaster
66 2

I solved it with a textbox. That is collecting the events.

link publish delete flag offensive edit

answered 2011-04-19 00:49:19 +0800

ramaa gravatar image ramaa
54

what is the code for space bar ??

link publish delete flag offensive edit

answered 2011-04-19 05:57:49 +0800

t702271 gravatar image t702271
63

whats the code for tab key?

link publish delete flag offensive edit

answered 2011-04-20 02:31:45 +0800

Manish77 gravatar image Manish77
42

updated 2011-04-20 02:32:39 +0800

please help me how to add,delete,uodate and view the list value in the databases

link publish delete flag offensive edit

answered 2011-04-20 10:29:09 +0800

Steva77 gravatar image Steva77 flag of Italy
1014 3
http://www.research.softe...

@Manish77: shouldn't you open a dedicated post? BTW, documentation is full of great resources from DB back ended MVC patterns...

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: 2008-10-03 08:29:50 +0800

Seen: 885 times

Last updated: Apr 20 '11

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