clipboard

I want to cut, copy and paste text.


Is client computer running windows everything runs via right mouse button.

Is client iphone or ipad i get problems to mark text 
In IOS a text is marked by touching for a longer time.
Then a magnifier and a menue appears to mark,cut, copy and paste.

This runs correct on tweblabels, twebpanels, twebbuttons... but 
not in twebedit and twebmemo. But exactly there i need it.

Any idea or tip ?

Is there access to clipboard functions at runtime ?
for example  webedit1.pastefromclipboard ?



Thanks for reporting the issue with input controls and iOS. We have traced & solved this issue. The next update will address this.


Wrt programmatic PasteFromClipboard, this is not possible in a browser as it is a potential security risk that a browser application could 'steal' all your clipboard content.

Is it possible to stuff a <ctrl>-V into the WEB Core keyboard buffer to trigger a Paste operation?

I'd like to have a little Paste button that you can click that just puts the clipboard data into an edit field. It can be a lot easier than trying to select one particular field from several.

This is a possible way:


type
  TForm1 = class(TWebForm)
    WebButton1: TWebButton;
    [async]
    procedure WebButton1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;


procedure TForm1.WebButton1Click(Sender: TObject);
begin
  asm
    const text = await navigator.clipboard.readText();
    console.log(text);
  end;
end;

but to get access to the clipboard the first time, the browser will give a warning dialog to allow.

1 Like