0

Transfer ctrlKeys and onCtrlKey

asked 2021-12-07 22:51:47 +0800

ivtu gravatar image ivtu
11 2

updated 2021-12-13 11:58:28 +0800

hawk gravatar image hawk
2941 1 5
http://hawkphoenix.blogsp... ZK Team

Hi,

I am using ZK 9.1.0 and I want to handle keyboard function keys. For example I want to use CTRL+Fx to select tabs. It works by using ctrlKeys and onCtrlKey on parent component. But after first try, focus is not anymore on tab's parent component and command is not fired anymore. I can satisfy if I put handling 'ctrlKeys' and 'onCtrlKey' on every inner component but that is too much.
Is it possible somehow to 'transfer' that event to the component (in this case window) which has ctrKeys handling?

zkfiddle

How to use:
1. Start fiddle
2. Press CTRL+F3
3. Third tab is selected
4. Without any action press CTRL+F2

delete flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2021-12-13 12:15:53 +0800

hawk gravatar image hawk
2941 1 5
http://hawkphoenix.blogsp... ZK Team

updated 2021-12-14 10:02:17 +0800

Because the focus is lost from the textbox, so keypress doesn't work. You can put focus back to the tabbox by

9.1

((HtmlBasedComponent)event.getTarget()).focus();

since 9.5

Clients.focus("tabbox"); in the end of doFireCtrlKeyEvent().

link publish delete flag offensive edit
0
link publish delete flag offensive edit
Your answer
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: 2021-12-07 22:51:47 +0800

Seen: 7 times

Last updated: Dec 14 '21

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