Skip to content

Commit

Permalink
New far:config VMenu.SwapHScrollDirection.
Browse files Browse the repository at this point in the history
Changes the meaning of the left and right keys in all menus and lists.
See `far:config` help for details.
  • Loading branch information
MKadaner committed Feb 4, 2024
1 parent 3a8e613 commit 9c7b66c
Show file tree
Hide file tree
Showing 11 changed files with 125 additions and 1 deletion.
15 changes: 15 additions & 0 deletions far/FarCze.hlf.m4
Original file line number Diff line number Diff line change
Expand Up @@ -6665,6 +6665,21 @@ or the search starting point.
This parameter can be changed via ~far:config~@FarConfig@ only.


@VMenu.SwapHScrollDirection
$ #far:config VMenu.SwapHScrollDirection#
This Boolean parameter swaps the direction of ~horizontal scrolling~@MenuCmd@
of menu and list box items.

False - ^<wrap>#Left# arrow scrolls items to the right, #Right# arrow scrolls items to the left.
In other words, these keys control the menu window.
True - #Left# arrow scrolls items to the left, #Right# arrow scrolls items to the right.
I.e., these keys control the menu items.

Default value: False (arrow keys control the menu window).

This parameter can be changed via ~far:config~@FarConfig@ only.


@XLat.Layouts
$ #far:config XLat.Layouts#
This string parameter defines the input locales (keyboard layouts)
Expand Down
15 changes: 15 additions & 0 deletions far/FarEng.hlf.m4
Original file line number Diff line number Diff line change
Expand Up @@ -6632,6 +6632,21 @@ or the search starting point.
This parameter can be changed via ~far:config~@FarConfig@ only.


@VMenu.SwapHScrollDirection
$ #far:config VMenu.SwapHScrollDirection#
This Boolean parameter swaps the direction of ~horizontal scrolling~@MenuCmd@
of menu and list box items.

False - ^<wrap>#Left# arrow scrolls items to the right, #Right# arrow scrolls items to the left.
In other words, these keys control the menu window.
True - #Left# arrow scrolls items to the left, #Right# arrow scrolls items to the right.
I.e., these keys control the menu items.

Default value: False (arrow keys control the menu window).

This parameter can be changed via ~far:config~@FarConfig@ only.


@XLat.Layouts
$ #far:config XLat.Layouts#
This string parameter defines the input locales (keyboard layouts)
Expand Down
15 changes: 15 additions & 0 deletions far/FarGer.hlf.m4
Original file line number Diff line number Diff line change
Expand Up @@ -6723,6 +6723,21 @@ or the search starting point.
This parameter can be changed via ~far:config~@FarConfig@ only.


@VMenu.SwapHScrollDirection
$ #far:config VMenu.SwapHScrollDirection#
This Boolean parameter swaps the direction of ~horizontal scrolling~@MenuCmd@
of menu and list box items.

False - ^<wrap>#Left# arrow scrolls items to the right, #Right# arrow scrolls items to the left.
In other words, these keys control the menu window.
True - #Left# arrow scrolls items to the left, #Right# arrow scrolls items to the right.
I.e., these keys control the menu items.

Default value: False (arrow keys control the menu window).

This parameter can be changed via ~far:config~@FarConfig@ only.


@XLat.Layouts
$ #far:config XLat.Layouts#
This string parameter defines the input locales (keyboard layouts)
Expand Down
15 changes: 15 additions & 0 deletions far/FarHun.hlf.m4
Original file line number Diff line number Diff line change
Expand Up @@ -6743,6 +6743,21 @@ or the search starting point.
This parameter can be changed via ~far:config~@FarConfig@ only.


@VMenu.SwapHScrollDirection
$ #far:config VMenu.SwapHScrollDirection#
This Boolean parameter swaps the direction of ~horizontal scrolling~@MenuCmd@
of menu and list box items.

False - ^<wrap>#Left# arrow scrolls items to the right, #Right# arrow scrolls items to the left.
In other words, these keys control the menu window.
True - #Left# arrow scrolls items to the left, #Right# arrow scrolls items to the right.
I.e., these keys control the menu items.

Default value: False (arrow keys control the menu window).

This parameter can be changed via ~far:config~@FarConfig@ only.


@XLat.Layouts
$ #far:config XLat.Layouts#
This string parameter defines the input locales (keyboard layouts)
Expand Down
15 changes: 15 additions & 0 deletions far/FarPol.hlf.m4
Original file line number Diff line number Diff line change
Expand Up @@ -6642,6 +6642,21 @@ lub osiągnie początkowy punkt wyszukiwania.
Ten parametr można zmienić tylko w ~far:config~@FarConfig@.


@VMenu.SwapHScrollDirection
$ #far:config VMenu.SwapHScrollDirection#
This Boolean parameter swaps the direction of ~horizontal scrolling~@MenuCmd@
of menu and list box items.

False - ^<wrap>#Left# arrow scrolls items to the right, #Right# arrow scrolls items to the left.
In other words, these keys control the menu window.
True - #Left# arrow scrolls items to the left, #Right# arrow scrolls items to the right.
I.e., these keys control the menu items.

Default value: False (arrow keys control the menu window).

This parameter can be changed via ~far:config~@FarConfig@ only.


@XLat.Layouts
$ #far:config XLat.Layouts#
Ten parametr tekstowy definiuje języki wejściowe (układy klawiatury),
Expand Down
15 changes: 15 additions & 0 deletions far/FarRus.hlf.m4
Original file line number Diff line number Diff line change
Expand Up @@ -6740,6 +6740,21 @@ $ #far:config Viewer.SearchWrapStop#
Изменить этот параметр можно только через ~far:config~@FarConfig@.


@VMenu.SwapHScrollDirection
$ #far:config VMenu.SwapHScrollDirection#
Этот логический (Boolean) параметр меняет направление ~горизонтального перемещения~@MenuCmd@
элементов меню и списков.

False - ^<wrap>Стрелка влево перемещает элементы вправо. Стрелка вправо перемещает элементы влево.
Другими словами, эти клавиши управляют окном меню.
True - Стрелка влево перемещает элементы влево. Стрелка вправо перемещает элементы вправо.
То есть, эти клавиши управляют элементами меню.

Значение по умолчанию: False (Стрелки управляют окном меню).

Изменить этот параметр можно только через ~far:config~@FarConfig@.


@XLat.Layouts
$ #far:config XLat.Layouts#
Этот строковый параметр определят языки ввода (раскладки клавиатуры),
Expand Down
15 changes: 15 additions & 0 deletions far/FarSky.hlf.m4
Original file line number Diff line number Diff line change
Expand Up @@ -6626,6 +6626,21 @@ or the search starting point.
This parameter can be changed via ~far:config~@FarConfig@ only.


@VMenu.SwapHScrollDirection
$ #far:config VMenu.SwapHScrollDirection#
This Boolean parameter swaps the direction of ~horizontal scrolling~@MenuCmd@
of menu and list box items.

False - ^<wrap>#Left# arrow scrolls items to the right, #Right# arrow scrolls items to the left.
In other words, these keys control the menu window.
True - #Left# arrow scrolls items to the left, #Right# arrow scrolls items to the right.
I.e., these keys control the menu items.

Default value: False (arrow keys control the menu window).

This parameter can be changed via ~far:config~@FarConfig@ only.


@XLat.Layouts
$ #far:config XLat.Layouts#
This string parameter defines the input locales (keyboard layouts)
Expand Down
15 changes: 15 additions & 0 deletions far/FarUkr.hlf.m4
Original file line number Diff line number Diff line change
Expand Up @@ -6714,6 +6714,21 @@ or the search starting point.
This parameter can be changed via ~far:config~@FarConfig@ only.


@VMenu.SwapHScrollDirection
$ #far:config VMenu.SwapHScrollDirection#
This Boolean parameter swaps the direction of ~horizontal scrolling~@MenuCmd@
of menu and list box items.

False - ^<wrap>#Left# arrow scrolls items to the right, #Right# arrow scrolls items to the left.
In other words, these keys control the menu window.
True - #Left# arrow scrolls items to the left, #Right# arrow scrolls items to the right.
I.e., these keys control the menu items.

Default value: False (arrow keys control the menu window).

This parameter can be changed via ~far:config~@FarConfig@ only.


@XLat.Layouts
$ #far:config XLat.Layouts#
This string parameter defines the input locales (keyboard layouts)
Expand Down
1 change: 1 addition & 0 deletions far/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2111,6 +2111,7 @@ void Options::InitConfigsData()
{FSSF_PRIVATE, NKeyVMenu, L"LBtnClick"sv, VMenu.LBtnClick, VMENUCLICK_CANCEL},
{FSSF_PRIVATE, NKeyVMenu, L"MBtnClick"sv, VMenu.MBtnClick, VMENUCLICK_APPLY},
{FSSF_PRIVATE, NKeyVMenu, L"RBtnClick"sv, VMenu.RBtnClick, VMENUCLICK_CANCEL},
{FSSF_PRIVATE, NKeyVMenu, L"SwapHScrollDirection"sv, VMenu.SwapHScrollDirection, false},
{FSSF_PRIVATE, NKeyXLat, L"Flags"sv, XLat.Flags, XLAT_SWITCHKEYBLAYOUT|XLAT_CONVERTALLCMDLINE},
{FSSF_PRIVATE, NKeyXLat, L"Layouts"sv, XLat.strLayouts, L""sv},
{FSSF_PRIVATE, NKeyXLat, L"Rules1"sv, XLat.Rules[0], L""sv},
Expand Down
1 change: 1 addition & 0 deletions far/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,7 @@ class Options: noncopyable
IntOption LBtnClick;
IntOption RBtnClick;
IntOption MBtnClick;
BoolOption SwapHScrollDirection;
};

struct CommandLineOptions
Expand Down
4 changes: 3 additions & 1 deletion far/vmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1509,7 +1509,9 @@ bool VMenu::ProcessKey(const Manager::Key& Key)

const auto HScrollShiftSign = [=]()
{
return any_of(LocalKey & ~KEY_CTRLMASK, KEY_LEFT, KEY_NUMPAD4, KEY_MSWHEEL_LEFT) ? 1 : -1;
return any_of(LocalKey & ~KEY_CTRLMASK, KEY_LEFT, KEY_NUMPAD4, KEY_MSWHEEL_LEFT) == Global->Opt->VMenu.SwapHScrollDirection
? -1
: 1;
};

switch (LocalKey)
Expand Down

0 comments on commit 9c7b66c

Please sign in to comment.