[Solved] Strange bug with TEdit lazarus / 31-LCL ---------------------------------------------------------------------- lainz · 2021-11-08 15:44 Hi, sometimes using a barcode scanner the TEdit is flipped, instead of writing from left to right it start writing from right to left. No, there's no change on the position of the text, is always left aligned. The problem is the cursor that is always at the left of the characters, so anything you write goes to the left. Notice that this mostly happens on slow hardware. ---------------------------------------------------------------------- winni · 2021-11-08 16:29 Hi! Do this on slow hardware: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.Edit1Change(Sender: TObject);begin  Edit1.SelStart:= Length(Edit1.Text);  AppliCation.ProcessMessages;end;  This will always position the cursor at the mostright position. Winni ---------------------------------------------------------------------- lainz · 2021-11-08 22:09 Thanks winni it works. But finally I solved it a bit differently, with an higher delay for the timer that prevents the search occur when the user types each character. From 20 ms to 100 ms and it works fine. ---------------------------------------------------------------------- lainz · 2021-11-10 13:58 Stranger enough... Now I found this code was the problem: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TPOSBerryLiteSearch.EnfocarBuscador;var  cp: TPoint;begin  if FEdit.Focused then    Exit;  cp := FEdit.CaretPos;  if FEdit.CanSetFocus then  begin    FEdit.SetFocus;    FEdit.CaretPos := cp;  end;end; Focusing works badly on Linux. So I removed this code and everything works fine again.