Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

248/252 Improve RIT and Bandwidth adjustment using mouse wheel #253

Merged
merged 7 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Main.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ object MainForm: TMainForm
OnKeyDown = FormKeyDown
OnKeyPress = FormKeyPress
OnKeyUp = FormKeyUp
OnMouseWheel = FormMouseWheel
OnMouseWheelDown = FormMouseWheelDown
OnMouseWheelUp = FormMouseWheelUp
PixelsPerInch = 96
TextHeight = 15
object Bevel1: TBevel
Expand Down
33 changes: 21 additions & 12 deletions Main.pas
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,11 @@ TMainForm = class(TForm)
procedure FormKeyPress(Sender: TObject; var Key: Char);
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure FormMouseWheel(Sender: TObject; Shift: TShiftState;
WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
procedure Edit1Enter(Sender: TObject);
procedure FormMouseWheelDown(Sender: TObject; Shift: TShiftState;
MousePos: TPoint; var Handled: Boolean);
procedure FormMouseWheelUp(Sender: TObject; Shift: TShiftState;
MousePos: TPoint; var Handled: Boolean);
procedure SendClick(Sender: TObject);
procedure Edit4Change(Sender: TObject);
procedure ComboBox2Change(Sender: TObject);
Expand Down Expand Up @@ -964,6 +966,23 @@ procedure TMainForm.Edit1Enter(Sender: TObject);
end;


procedure TMainForm.FormMouseWheelDown(Sender: TObject; Shift: TShiftState;
MousePos: TPoint; var Handled: Boolean);
begin
if GetKeyState(VK_CONTROL) >= 0 then IncRit(1)
else if RunMode <> rmHst then SetBw(ComboBox2.ItemIndex-1);
Handled := true; // set Handled to prevent being called 3 times
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change has been applied in many forks over time. However, none of them had detected or fixed the problem of multiple events being handled for a single mouse wheel click/movement. By setting Handled=true, only one event is handled. This was important for smooth operation of Bandwidth control using the Cntl-key.

end;

procedure TMainForm.FormMouseWheelUp(Sender: TObject; Shift: TShiftState;
MousePos: TPoint; var Handled: Boolean);
begin
if GetKeyState(VK_CONTROL) >= 0 then IncRit(-1)
else if RunMode <> rmHst then SetBw(ComboBox2.ItemIndex+1);
Handled := true; // set Handled to prevent being called 3 times
end;


procedure TMainForm.IncSpeed;
begin
if RunMode = rmHST then
Expand Down Expand Up @@ -1935,16 +1954,6 @@ procedure TMainForm.Panel8MouseDown(Sender: TObject; Button: TMouseButton;
end;


procedure TMainForm.FormMouseWheel(Sender: TObject; Shift: TShiftState;
WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
begin
if WheelDelta>0 then
IncRit(2)
else
IncRit(-2)
end;


procedure TMainForm.Shape2MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
Expand Down
3 changes: 3 additions & 0 deletions Readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,9 @@ Version 1.80 (Oct 2022)
- Change default Font to Cleartype 'segoe ui', 'Consolar';
- Change string to Unicode, Building with Delphi 2010 sp3.

1.68.4+
- The mouse wheel now acts as RIT. (F6FVY)

1.68 (VE3NEA) 2016
- TU + MyCall after the QSO is now equivalent to CQ

Expand Down