|
Re: Extension org.eclipse.ui.bindings [message #492203 is a reply to message #492166] |
Mon, 19 October 2009 12:48 |
Dmitry Pryadkin Messages: 146 Registered: July 2009 |
Senior Member |
|
|
Hello Jung,
I'm not a platform developer, but a user.
From my point of view, this is a challenging task, because the browser
will intercept certain keys or combinations. You really can't do much
with the control key, as some browsers use it for keyboard shortcuts and
intercept it before it gets to any scripts.
Here's some simple javascript code that you can use to register your own
handler for the entire document. It can catch key-events, except for
those that got intercepted by browser.
var myKeydown = function(e)
{
if(typeof window.event!="undefined"){
e=window.event;//code for IE
}
// TODO
}
if(document.addEventListener) // Opera, Mozilla
{
document.addEventListener("keydown",myKeydown ,false);
document.addEventListener("keypress",myKeydown ,false);
}
else
{
document.attachevent("onkeydown",myKeydown ); //code for IE
document.attachevent("onkeypress",myKeydown );
}
Dmitry
JUNG wrote:
> Hello Everybody,
> In RCP, the extension org.eclipse.ui.bindings allows to associate keys
> with commands (e.g. Ctrl-C with copy command).
> I tried to do the same thing in RAP (1.2). But it seems that
> org.eclipse.ui.bindings does not exist. How can we do this in RAP?
> Thank you in advance for your help.
> Best regards,
> JUNG
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03391 seconds