Ich habe es jetzt ganz brauchbar hin bekommen.
Falls es jemandem mal hilft:
Delphi-Quellcode:
unit uRichEdit;
interface
uses
Vcl.ComCtrls, System.Classes,
Winapi.Messages;
type
TRichEdit =
class(
Vcl.ComCtrls.TRichEdit)
protected
procedure WMMouseWheel(
var Msg: TWMMouseWheel);
message WM_MOUSEWHEEL;
procedure WMVScroll(
var Msg: TWMScroll);
message WM_VSCROLL;
public
constructor Create(AOwner: TComponent);
override;
destructor Destroy;
override;
end;
implementation
uses
Winapi.Windows, System.SysUtils;
{ TRichEdit }
constructor TRichEdit.Create(AOwner: TComponent);
begin
inherited;
end;
destructor TRichEdit.Destroy;
begin
inherited;
end;
procedure TRichEdit.WMVScroll(
var Msg: TWMScroll);
var
mPos : Integer;
mPosM: Integer;
begin
mPos := Msg.Pos;
mPosM := (mPos
mod 14);
if (mPosM > 0)
then
begin
Msg.Pos := (mPos - mPosM);
end;
inherited;
// OutputDebugString(PWideChar(IntToStr(mPos) + ' / ' + IntToStr(mPosM) + ' -> ' + IntToStr(Msg.Pos)));
end;
procedure TRichEdit.WMMouseWheel(
var Msg: TWMMouseWheel);
var
mPos : Integer;
mPosM: Integer;
begin
if (Msg.Keys = 1)
then
Msg.Keys := 0;
//: Zoom-Bug der Logitec MX Master 3 unterdrücken
mPos := Msg.WheelDelta;
mPosM := (mPos
mod 14);
if (mPosM > 0)
then
begin
Msg.WheelDelta := (mPos - mPosM);
end;
inherited;
// OutputDebugString(PWideChar(IntToStr(mPos) + ' / ' + IntToStr(mPosM) + ' -> ' + IntToStr(Msg.WheelDelta)));
end;
end.