This content has been marked as final.
Show 3 replies
-
1. Re: Listing hotKeys active for a page
nbelaevski Nov 16, 2008 4:24 PM (in response to supernovasoftware.com)Hi,
Try this:<body onload="showMappings()"> <rich:hotKey key="alt-a" selector="span" /> <rich:hotKey key="shift-b" selector="span" /> <rich:hotKey key="c" selector="span" /> <script type="text/javascript"> function showMappings() { var mappings = {}; var all = jQuery.hotkeys.all; if (all) { for ( var name in all) { var elt = all[name]; if (elt.events) { for (var eventName in elt.events) { var combi = elt.events[eventName]; if (combi.callbackMap) { for (var key in combi.callbackMap) { mappings[key] = true; } } } } } } var result = new Array(); for (var mapping in mappings) { result.push(mapping); } alert(result); } </script> ... </body>
-
2. Re: Listing hotKeys active for a page
supernovasoftware.com Nov 17, 2008 11:00 AM (in response to supernovasoftware.com)That works quite nicely.
Thank you for the tip.
I would now like to display some information about what the hotkey will do.
I guess I could tie this to my messages, but different hotkeys could do different things on different pages.
Any advice on the best way to implement this? -
3. Re: Listing hotKeys active for a page
ilya_shaikovsky Nov 19, 2008 9:03 AM (in response to supernovasoftware.com)As for me I think messages is a good enough to perform this. You could just create alternate messages for some hotKeys which could be defined with the different meaning.