WPCubed Product Support

Always use soft line breaks?

wpsupport

this does it

procedure TForm1.WPRichText1KeyDown(Sender: TObject; var Key: Word;
 Shift: TShiftState);
begin
   if Key=VK_RETURN then
   begin
       WPRichText1.InputString(#10);
       Key := 0;
   end;
end;
#4 ♥ 1
1.9k Views 2 users 2 ♥ read 1 min

Hm, this doesn't seem to work:

procedure TForm1.WPKeyPress(Sender: TObject; var Key: Char);
begin
  if Key = #13 then
    Key := #10;
end;

I can see that it captures the #13 and converts it to #10, but WP still treats it as a hard line break, creating new paragraphs instead of continuing the text within the same paragraph.

#3 ♥ 0
wpsupport

You can change the key from #13 to #10 on OnKeyPress

#2 ♥ 1

Is there a way to configure WP to always use soft line breaks when the user presses return?

#1 ♥ 0