From f2010fe093f7fda97fd8f19680751dd479913376 Mon Sep 17 00:00:00 2001 From: "SONATA_W7\\Laurent" Date: Sat, 3 Nov 2018 00:13:16 +0100 Subject: [PATCH 1/7] Implement the MouseWheel as RIT --- Main.dfm | 3 ++- Main.pas | 31 +++++++++++++++++++------------ Readme.txt | 3 +++ 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/Main.dfm b/Main.dfm index 71756ab..5145f1a 100644 --- a/Main.dfm +++ b/Main.dfm @@ -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 diff --git a/Main.pas b/Main.pas index 6361cfc..2b97cb6 100644 --- a/Main.pas +++ b/Main.pas @@ -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); @@ -964,6 +966,21 @@ 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); +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); +end; + + procedure TMainForm.IncSpeed; begin if RunMode = rmHST then @@ -1935,16 +1952,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 diff --git a/Readme.txt b/Readme.txt index a971319..43527a7 100644 --- a/Readme.txt +++ b/Readme.txt @@ -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 From ef6781c1127e373bdd1bec0742d0bdd00a94a527 Mon Sep 17 00:00:00 2001 From: Mike Brashler Date: Sun, 18 Feb 2024 18:39:15 -0800 Subject: [PATCH 2/7] Fix Mouse Wheel handler to process one event only --- Main.pas | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Main.pas b/Main.pas index 2b97cb6..908c8ad 100644 --- a/Main.pas +++ b/Main.pas @@ -971,6 +971,7 @@ procedure TMainForm.FormMouseWheelDown(Sender: TObject; Shift: TShiftState; 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.FormMouseWheelUp(Sender: TObject; Shift: TShiftState; @@ -978,6 +979,7 @@ procedure TMainForm.FormMouseWheelUp(Sender: TObject; Shift: TShiftState; 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; From 94fccd318d99d83a4e3ee22071b9dbd739623db2 Mon Sep 17 00:00:00 2001 From: Mike Brashler Date: Sun, 18 Feb 2024 18:38:28 -0800 Subject: [PATCH 3/7] update RIT hover help message (K6OK) --- Main.dfm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Main.dfm b/Main.dfm index 5145f1a..309e940 100644 --- a/Main.dfm +++ b/Main.dfm @@ -297,7 +297,7 @@ object MainForm: TMainForm Width = 225 Height = 10 Cursor = crHandPoint - Hint = 'RIT' + Hint = 'RIT -- Use Up/Down keys or Mouse Wheel; Hold Control key for BW.' BevelOuter = bvLowered ParentShowHint = False ShowHint = True From 0e18352641479db73b649e02d32e82139ba3c0ee Mon Sep 17 00:00:00 2001 From: Mike Brashler Date: Mon, 19 Feb 2024 00:27:55 -0800 Subject: [PATCH 4/7] update Readme.txt --- Readme.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Readme.txt b/Readme.txt index 43527a7..2689ca9 100644 --- a/Readme.txt +++ b/Readme.txt @@ -153,9 +153,9 @@ KEY ASSIGNMENTS Enter - sends various messages, depending on the state of the QSO; - Up/Down arrows - RIT; + Up/Down arrows, mouse wheel - RIT; - Ctrl-Up/Ctrl-Down arrows - bandwidth; + Ctrl-Up/Ctrl-Down arrows, Cntl-key with mouse wheel - bandwidth; PgUp/PgDn, Ctrl-F10/Ctrl-F9, Alt-F10/Alt-F9 - keying speed, in 2 WPM increments. HST Competition uses 5 WPM increments. @@ -230,6 +230,8 @@ Version 1.84 (February 2024) - All Contests - spacebar or Tab will now select both exchange fields (Coded by W7SST) - All Contests - Hide Dx Station's Entity status string if same as user's Entity (Coded by W7SST) - K1USN SST - user test field in call history file should be optional (Coded by W7SST) + - Improve RIT adjustment using mouse wheel (F6FVY, W7SST) + - Add receive Bandwidth adjustment using Cntl-key and mouse wheel (F6FVY, W7SST) - DX station will send an abbreviated exchange number in the JARL ALLJA and ACAG contests (Coded by JR8PPG) - User's exchange number is not abbreviated (not convert 100 to 1TT) (Coded by JR8PPG) From 97485efdc26aafe9504f9dd4647cfe0491a2f714 Mon Sep 17 00:00:00 2001 From: Mike Brashler Date: Mon, 19 Feb 2024 09:44:07 -0800 Subject: [PATCH 5/7] Add Ini.RitStepIncr to override RIT step increment #248 --- Ini.pas | 4 ++++ Main.pas | 23 +++++++++++++++++------ Readme.txt | 18 +++++++++++++++--- 3 files changed, 36 insertions(+), 9 deletions(-) diff --git a/Ini.pas b/Ini.pas index d0e82ad..b181867 100644 --- a/Ini.pas +++ b/Ini.pas @@ -193,6 +193,7 @@ TContestDefinition = record Pitch: integer = 600; Qsk: boolean = false; Rit: integer = 0; + RitStepIncr: integer = 50; BufSize: integer = DEFAULTBUFSIZE; WebServer: string = ''; SubmitHiScoreURL: string= ''; @@ -324,6 +325,8 @@ procedure FromIni; // [Settings] FarnsworthCharRate := ReadInteger(SEC_SET, 'FarnsworthCharacterRate', FarnsworthCharRate); + RitStepIncr := ReadInteger(SEC_SET, 'RitStepIncr', RitStepIncr); + RitStepIncr := Max(-500, Min(500, RitStepIncr)); // [Debug] DebugExchSettings := ReadBool(SEC_DBG, 'DebugExchSettings', DebugExchSettings); @@ -395,6 +398,7 @@ procedure ToIni; WriteBool(SEC_STN, 'SaveWav', SaveWav); WriteInteger(SEC_SET, 'FarnsworthCharacterRate', FarnsworthCharRate); + WriteInteger(SEC_SET, 'RitStepIncr', RitStepIncr); finally Free; end; diff --git a/Main.pas b/Main.pas index 908c8ad..947de17 100644 --- a/Main.pas +++ b/Main.pas @@ -363,6 +363,7 @@ TMainForm = class(TForm) MustAdvance: boolean; // Controls when Exchange fields advance UserCallsignDirty: boolean; // SetMyCall is called after callsign edits CWSpeedDirty: boolean; // SetWpm is called after CW Speed edits + RitLocal: integer; // tracks incremented RIT Value function CreateContest(AContestId : TSimContest) : TContest; procedure ConfigureExchangeFields; procedure SetMyExch1(const AExchType: TExchange1Type; const Avalue: string); @@ -1979,16 +1980,26 @@ procedure TMainForm.ClientHTTP1Redirect(Sender: TObject; var dest: string; procedure TMainForm.IncRit(dF: integer); +var + RitStepIncr : integer; begin + RitStepIncr := IfThen(RunMode = rmHST, 50, Ini.RitStepIncr); + + // A negative RitStepInc will change direction of arrow/wheel movement + if RitStepIncr < 0 then begin + dF := -dF; + RitStepIncr := -RitStepIncr; + end; + case dF of - -2: Inc(Ini.Rit, -5); - -1: Inc(Ini.Rit, -50); - 0: Ini.Rit := 0; - 1: Inc(Ini.Rit, 50); - 2: Inc(Ini.Rit, 5); + -2: if Ini.Rit > -500 then Inc(RitLocal, -5); + -1: if Ini.Rit > -500 then Inc(RitLocal, -RitStepIncr); + 0: RitLocal := 0; + 1: if Ini.Rit < 500 then Inc(RitLocal, RitStepIncr); + 2: if Ini.Rit < 500 then Inc(RitLocal, 5); end; - Ini.Rit := Min(500, Max(-500, Ini.Rit)); + Ini.Rit := Min(500, Max(-500, RitLocal)); UpdateRitIndicator; end; diff --git a/Readme.txt b/Readme.txt index 2689ca9..b4c186d 100644 --- a/Readme.txt +++ b/Readme.txt @@ -153,9 +153,21 @@ KEY ASSIGNMENTS Enter - sends various messages, depending on the state of the QSO; - Up/Down arrows, mouse wheel - RIT; - - Ctrl-Up/Ctrl-Down arrows, Cntl-key with mouse wheel - bandwidth; + Up/Down arrows, mouse wheel - RIT adjustment. + The Up/Down arrow keys or the mouse wheel can be used to adjust the + receive RIT value. RIT can be adjusted between -500 and 500 Hz. + The default RIT increment is 50Hz/Step. You can modify the RIT step + increment using the RitStepIncr entry in the MorseRunner.ini file, e.g.: + [Settings] + RitStepIncr=50 + + Valid values range between -500 and 500. Useful values include 100, 125, + 167 and 250 will provide 5, 4, 3 or 2 steps respectively in both directions. + Negative values can be used to change the direction of Up/Down arrow keys + or mouse movement. Note that a zero value will disable this feature. + HST Competition mode will ignore this setting and is set to 50Hz/Step. + + Ctrl-Up/Ctrl-Down arrows, Cntl-key with mouse wheel - Bandwidth adjustment. PgUp/PgDn, Ctrl-F10/Ctrl-F9, Alt-F10/Alt-F9 - keying speed, in 2 WPM increments. HST Competition uses 5 WPM increments. From 50954a793d64d370a27d6f4aef416a283502deaa Mon Sep 17 00:00:00 2001 From: Mike Brashler Date: Mon, 19 Feb 2024 09:53:26 -0800 Subject: [PATCH 6/7] Update Readme.txt --- Readme.txt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Readme.txt b/Readme.txt index b4c186d..27c400a 100644 --- a/Readme.txt +++ b/Readme.txt @@ -161,13 +161,14 @@ KEY ASSIGNMENTS [Settings] RitStepIncr=50 - Valid values range between -500 and 500. Useful values include 100, 125, - 167 and 250 will provide 5, 4, 3 or 2 steps respectively in both directions. - Negative values can be used to change the direction of Up/Down arrow keys - or mouse movement. Note that a zero value will disable this feature. - HST Competition mode will ignore this setting and is set to 50Hz/Step. + Valid values range between -500 and 500. Negative values can be used to + change the direction of Up/Down arrow keys or mouse movement. Note that a + zero value will disable this feature. HST Competition mode will ignore this + setting and is set to 50Hz/Step. Ctrl-Up/Ctrl-Down arrows, Cntl-key with mouse wheel - Bandwidth adjustment. + Pressing the Ctrl-key while using the Up/Down arrows or moving the mouse + wheel will adjust the receive bandwidth. PgUp/PgDn, Ctrl-F10/Ctrl-F9, Alt-F10/Alt-F9 - keying speed, in 2 WPM increments. HST Competition uses 5 WPM increments. From 1683f5fbee0cdda1dc1fb1114705e33833f2dce4 Mon Sep 17 00:00:00 2001 From: Mike Brashler Date: Mon, 19 Feb 2024 10:13:32 -0800 Subject: [PATCH 7/7] update version number to 1.84-pr4 --- Main.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Main.pas b/Main.pas index 947de17..ce1202a 100644 --- a/Main.pas +++ b/Main.pas @@ -21,7 +21,7 @@ interface const WM_TBDOWN = WM_USER+1; - sVersion: String = '1.84-pr3'; { Sets version strings in UI panel. } + sVersion: String = '1.84-pr4'; { Sets version strings in UI panel. } type