URL with Ctrl in RichView

General TRichView support forum. Please post your questions here
Post Reply
monsoon
Posts: 4
Joined: Mon May 24, 2010 9:37 am

URL with Ctrl in RichView

Post by monsoon »

Sergey Tkachenko wrote:In a read-only editor, hypertext works automatically, without Ctrl. Only when editing, it requires pressing and holding Ctrl.
Whether it is possible to make, that pressing and holding Ctrl work in a RichView?
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I do not completely understand your question.

In TRichView and read-only TRichViewEdit, hypertext always work, even without pressing Ctrl.
In editable TRichViewEdit, hypertext works with Ctrl (if rvoCtrlJumps in EditorOptions).
monsoon
Posts: 4
Joined: Mon May 24, 2010 9:37 am

Post by monsoon »

Sergey Tkachenko wrote:I do not completely understand your question.

In TRichView and read-only TRichViewEdit, hypertext always work, even without pressing Ctrl.
In editable TRichViewEdit, hypertext works with Ctrl (if rvoCtrlJumps in EditorOptions).
It is necessary for me, that in TRichView hypertext works only with Ctrl and don't work without Ctrl
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Sorry, there are no ways to disable hypertext in TRichView.
You can only prevent executing any link if Ctrl is not pressed.
In OnJump event:

Code: Select all

procedure TForm1.RichView1Jump(Sender: TObject; id: Integer);
var KeyboardState: TKeyboardState;
begin
  GetKeyboardState(KeyboardState);
  if KeyboardState[VK_CONTROL] and $80 = 0 then
    exit;
  <process hyperlink click here>
end;
Last edited by Sergey Tkachenko on Wed Jul 28, 2010 1:10 pm, edited 1 time in total.
monsoon
Posts: 4
Joined: Mon May 24, 2010 9:37 am

Post by monsoon »

Sorry, I add in event OnJump function GetKeyState for Ctrl and now it's all work
monsoon
Posts: 4
Joined: Mon May 24, 2010 9:37 am

Post by monsoon »

Your answer almost same. :wink:
Thanks for help.
Post Reply