Correct, CTRL is passed as one of the flags, it is V you are trapping.

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Jeremy Coulter
> Sent: Friday, 7 September 2001 12:55
> To: Multiple recipients of list delphi
> Subject: RE: [DUG]: Trapping ctrl+v
>
>
> AH...sorted it. I was thinking to myself....hang on. dont I need to trap
> BOTH the ctrl+v key combination as a VALUE ?
>
> In VB you go if key = vbKeyCtrl+vbKeyV then blah
> So I tride the delphi equiv. and I was right....love being right....hehehe
>
> Thanks, Jeremy Coulter
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Andrew Little
> Sent: Thursday, 6 September 2001 16:44
> To: Multiple recipients of list delphi
> Subject: Re: [DUG]: Trapping ctrl+v
>
>
> Hi,
>
> This is a bit clugie, but it seems to work :) There is probably an API
> hidden away some where.
>
>
> FCtrl: Boolean;
> FVKey: Boolean;
>
> ...
>
> procedure TForm1.Memo1KeyDown(Sender: TObject; var Key: Word;
>   Shift: TShiftState);
> begin
>   FCtrl := ssCtrl in Shift;
> end;
>
> procedure TForm1.Memo1KeyPress(Sender: TObject; var Key: Char);
> var
>   pt: TPoint;
>   s: string;
> begin
>   FV := Key = #22;
>   if FV and FCtrl then
>   begin
>      pt := (Sender as TMemo).CaretPos;
>      s := (Sender as TMemo).Lines[pt.y];
>      Insert('// this is a comment' + #$D#$A, s, pt.x);
>      (Sender as TMemo).Lines[pt.y] := s;
>   end;
> end;
>
>
> Hope this helps?
> Andrew.
>
>
> ----- Original Message -----
> From: "vss" <[EMAIL PROTECTED]>
> To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
> Sent: Thursday, September 06, 2001 3:52 PM
> Subject: [DUG]: Trapping ctrl+v
>
>
> > HI All.
> >
> > I have a need to trap when someone does a paste into a control, so I can
> > add some comments above the newly pasted text.
> >
> > What I am currently doing is if the press ctrl+v I get the line
> pos where
> > the text is about to pasted to, then insert some text at that pos-1
> >
> > This does not quite work. I WOULD like to trap the event and do  what I
> > need to.
> >
> > Can anyone give me some ideas ?
> >
> > Thanks, Jeremy Coulter
> >
> >
> >
> --------------------------------------------------------------------------
> -
> >     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
> >                   Website: http://www.delphi.org.nz
> > To UnSub, send email to: [EMAIL PROTECTED]
> > with body of "unsubscribe delphi"
> > Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
> >
> >
> >
>
> ------------------------------------------------------------------
> ---------
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"
> Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
>
>
> ------------------------------------------------------------------
> ---------
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"
> Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
>

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to