Repository :
https://github.com/FarGroup/FarManager
On branch : master
Link :
https://github.com/FarGroup/FarManager/commit/ae6078f758c1b1a56da0e197f3bd6692e996d1b1
>---------------------------------------------------------------
commit ae6078f758c1b1a56da0e197f3bd6692e996d1b1
Author: Shmuel Zeigerman <
solo...@gmail.com>
Date: Sun Dec 21 22:01:49 2025 +0200
Remove some old and unused code
>---------------------------------------------------------------
ae6078f758c1b1a56da0e197f3bd6692e996d1b1
far/changelog | 5 +++++
far/keyboard.cpp | 21 +++++++--------------
far/vbuild.m4 | 2 +-
3 files changed, 13 insertions(+), 15 deletions(-)
diff --git a/far/changelog b/far/changelog
index b7f849154..a0aeb416c 100644
--- a/far/changelog
+++ b/far/changelog
@@ -1,3 +1,8 @@
+--------------------------------------------------------------------------------
+shmuel 2025-12-21 21:59:27+02:00 - build 6618
+
+1. Remove some old and unused code.
+
--------------------------------------------------------------------------------
drkns 2025-12-19 23:14:02+00:00 - build 6617
diff --git a/far/keyboard.cpp b/far/keyboard.cpp
index e12eff4e3..93e327c0b 100644
--- a/far/keyboard.cpp
+++ b/far/keyboard.cpp
@@ -406,7 +406,7 @@ int SetFLockState(unsigned const vkKey, int const State)
return oldState;
}
-static unsigned int ShieldCalcKeyCode(INPUT_RECORD* rec, bool RealKey, bool* NotMacros = {});
+static unsigned int ShieldCalcKeyCode(INPUT_RECORD* rec, bool RealKey);
unsigned int InputRecordToKey(const INPUT_RECORD* Rec)
{
@@ -890,7 +890,7 @@ static bool ProcessMouseEvent(MOUSE_EVENT_RECORD& MouseEvent, bool ExcludeMacro,
return false;
}
-static unsigned int CalcKeyCode(INPUT_RECORD* rec, bool RealKey, bool* NotMacros = {});
+static unsigned int CalcKeyCode(INPUT_RECORD* rec, bool RealKey);
static DWORD GetInputRecordImpl(INPUT_RECORD *rec,bool ExcludeMacro,bool ProcessMouse)
{
@@ -906,11 +906,9 @@ static DWORD GetInputRecordImpl(INPUT_RECORD *rec,bool ExcludeMacro,bool Process
}
}
- auto NotMacros = false;
-
const auto ProcessMacroEvent = [&]
{
- if (NotMacros || ExcludeMacro)
+ if (ExcludeMacro)
return CalcKey;
const FAR_INPUT_RECORD irec{ CalcKey, *rec };
@@ -925,8 +923,6 @@ static DWORD GetInputRecordImpl(INPUT_RECORD *rec,bool ExcludeMacro,bool Process
{
CalcKey=KeyQueue().front();
KeyQueue().pop_front();
- NotMacros = (CalcKey & 0x80000000) != 0;
- CalcKey &= ~0x80000000;
return ProcessMacroEvent();
}
@@ -1066,7 +1062,7 @@ static DWORD GetInputRecordImpl(INPUT_RECORD *rec,bool ExcludeMacro,bool Process
}
IntKeyState.ReturnAltValue = false;
- CalcKey=CalcKeyCode(rec, true, &NotMacros);
+ CalcKey=CalcKeyCode(rec, true);
if (IntKeyState.ReturnAltValue)
{
@@ -1831,11 +1827,11 @@ bool IsCharKey(unsigned int Key)
return Key < 0x10000 || in_closed_range(KEY_MULTIPLY, Key, KEY_DIVIDE);
}
-static unsigned int ShieldCalcKeyCode(INPUT_RECORD* rec, bool RealKey, bool* NotMacros)
+static unsigned int ShieldCalcKeyCode(INPUT_RECORD* rec, bool RealKey)
{
const auto SavedIntKeyState = IntKeyState; // нада! ибо CalcKeyCode "портит"... (Mantis#0001760)
IntKeyState = {};
- const auto Ret = CalcKeyCode(rec, RealKey, NotMacros);
+ const auto Ret = CalcKeyCode(rec, RealKey);
IntKeyState = SavedIntKeyState;
return Ret;
}
@@ -2036,16 +2032,13 @@ static int GetMouseKey(const MOUSE_EVENT_RECORD& MouseEvent)
return 0;
}
-static unsigned int CalcKeyCode(INPUT_RECORD* rec, bool RealKey, bool* NotMacros)
+static unsigned int CalcKeyCode(INPUT_RECORD* rec, bool RealKey)
{
const auto CtrlState = rec->EventType==MOUSE_EVENT? rec->Event.MouseEvent.dwControlKeyState : rec->Event.KeyEvent.dwControlKeyState;
const auto ScanCode = rec->Event.KeyEvent.wVirtualScanCode;
const auto KeyCode = rec->Event.KeyEvent.wVirtualKeyCode;
const auto Char = rec->Event.KeyEvent.uChar.UnicodeChar;
- if (NotMacros)
- *NotMacros = (CtrlState&0x80000000) != 0;
-
if (!(rec->EventType==KEY_EVENT || rec->EventType == MOUSE_EVENT))
return KEY_NONE;
diff --git a/far/vbuild.m4 b/far/vbuild.m4
index cc7beecdb..60345e8b4 100644
--- a/far/vbuild.m4
+++ b/far/vbuild.m4
@@ -1 +1 @@
-6617
+6618