[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: How can I catch the Ctrl_C or Ctrl_V event in the StyledText widget

StyledText does cut, copy and paste for you automatically. You don't need do 
anything.

If you really must listen for these in your StyledText (not recommended), 
then yes, you need to add a KeyListener and in keyPressed, check for 
something like (event.stateMask & SWT.CTRL) != 0 && (event.character + 64) 
== 'C'.

Carolyn

"yong.yu" <yuyong22@xxxxxxxxxxx> wrote in message 
news:d1a7551b96c47f9bc5d9f47f49234655$1@xxxxxxxxxxxxxxxxxx
> Dear everyone.
> I have this question in my swt project.
> How can I catch the Ctrl_C or Ctrl_V event in the StyledText widget.
> Which event listener belongs to the widget should I use. KeyListener or 
> anyone else.
>
> Thanks 4 your reply.
> --------------------
>
> Yours sincerely,
> yong.yu
>
> Skype:yuyong88
>