Home » Eclipse Projects » GEF » KeyHandler for Cut, Copy, Paste
KeyHandler for Cut, Copy, Paste [message #234966] |
Sat, 02 June 2007 10:54 |
Eclipse User |
|
|
|
Originally posted by: rajmohanpk.hcl.in
Hi,
I'm using Eclipse GEF and RCP framework in developing an application, i
want to map the Ctrl+X, Ctrl+C, Ctrl+V keyboard actions for cut, copy,
paste operations respectively. I have tried the following keysequence and
it works, but i want to map it with the above standard actions.
sharedKeyHandler.put(KeyStroke.getPressed(SWT.CTRL, 0),
getActionRegistry().getAction(ActionFactory.CUT.getId()));
sharedKeyHandler.put(KeyStroke.getPressed(SWT.F2, 0),
getActionRegistry().getAction(ActionFactory.COPY.getId()));
sharedKeyHandler.put(KeyStroke.getPressed(SWT.F3, 0),
getActionRegistry().getAction(ActionFactory.PASTE.getId()));
Please let me know, how to do the same.
Thanks!,
Rajmohan
|
|
|
Re: KeyHandler for Cut, Copy, Paste [message #234977 is a reply to message #234966] |
Sat, 02 June 2007 11:03 |
Eclipse User |
|
|
|
Originally posted by: rajmohanpk.hcl.in
Also i have tried the following code snippet, and it is *NOT* working.
sharedKeyHandler.put(
KeyStroke.getPressed( 'C', 0, SWT.CTRL ),
getActionRegistry().getAction(IWorkbenchActionConstants.COPY ));
sharedKeyHandler.put(
KeyStroke.getPressed( 'X', 0, SWT.CTRL ),
getActionRegistry().getAction(IWorkbenchActionConstants.CUT) );
sharedKeyHandler.put(
KeyStroke.getPressed( 'V', 0, SWT.CTRL ),
getActionRegistry().getAction(IWorkbenchActionConstants.PAST E));
Please Help.
|
|
| |
Goto Forum:
Current Time: Wed Apr 24 20:10:15 GMT 2024
Powered by FUDForum. Page generated in 0.03043 seconds
|