FIRE-21625: Add option to remap special shortcuts on Linux already in use by the operating system; based on a patch by Thickbrick Sleaford

meow-7.2.2
Ansariel 2017-11-02 19:07:07 +01:00
parent 0c317a9b97
commit 9fe9028476
7 changed files with 56 additions and 9 deletions

View File

@ -127,6 +127,7 @@ static LLDefaultChildRegistry::Register<LLMenuGL> register_menu_default("menu");
LLMenuItemGL::Params::Params()
: shortcut("shortcut"),
shortcut_linux("shortcut_linux"), // <FS> Remap shortcuts on Linux
jump_key("jump_key", KEY_NONE),
use_mac_ctrl("use_mac_ctrl", false),
allow_key_repeat("allow_key_repeat", false),
@ -171,6 +172,15 @@ LLMenuItemGL::LLMenuItemGL(const LLMenuItemGL::Params& p)
#endif // LL_DARWIN
std::string shortcut = p.shortcut;
// <FS> Remap shortcuts on Linux
#ifdef LL_LINUX
static LLUICachedControl<bool> fsRemapLinuxShortcuts("FSRemapLinuxShortcuts", false);
if (fsRemapLinuxShortcuts && p.shortcut_linux.isProvided())
{
shortcut = p.shortcut_linux;
}
#endif // LL_LINUX
// </FS>
if (shortcut.find("control") != shortcut.npos)
{
#ifdef LL_DARWIN

View File

@ -55,6 +55,7 @@ public:
struct Params : public LLInitParam::Block<Params, LLUICtrl::Params>
{
Optional<std::string> shortcut;
Optional<std::string> shortcut_linux; // <FS> Remap shortcuts on Linux
Optional<KEY> jump_key;
Optional<bool> use_mac_ctrl,
allow_key_repeat;

View File

@ -24478,6 +24478,17 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>Value</key>
<integer>0</integer>
</map>
<key>FSRemapLinuxShortcuts</key>
<map>
<key>Comment</key>
<string>If enabled, use the special shortcuts on Linux to remap shortcuts that are already in use by the operating system (e.g. CTRL-ALT-Fx)</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
</map>
</llsd>

View File

@ -793,13 +793,19 @@ BOOL LLFloaterPreference::postBuild()
#endif
// </FS:Ansariel>
// <FS:Ansariel> Disable options only available on Windows on other platforms
// <FS:Ansariel> Disable options only available on Windows and not on other platforms
#ifndef LL_WINDOWS
childSetEnabled("FSEnableAutomaticUIScaling", FALSE);
childSetEnabled("FSDisableWMIProbing", FALSE);
#endif
// </FS:Ansariel>
// <FS:Ansariel> Disable options only available on Linux and not on other platforms
#ifndef LL_LINUX
childSetEnabled("FSRemapLinuxShortcuts", FALSE);
#endif
// </FS:Ansariel>
return TRUE;
}

View File

@ -73,6 +73,7 @@
<text name="FSLegacyNotificationWellRequiresRestart">
(Erfordert Neustart)
</text>
<check_box label="Shortcuts anpassen, die von Linux verwendet werden (nur Linux; erfordert Neustart)" name="FSRemapLinuxShortcuts" tool_tip="Aktivieren, die Shortcuts umzudefinieren, die bereits durch das Linux-Betriebssystem verwendet werden, z.B. STRG-ALT-Fx."/>
<slider label_width="230" label="Wiederholungen für blinkende IM-Reiter:" name="ButtonsFlashCount"/>
<slider label_width="230" label="Aufblinkdauer für IM-Reiter:" tool_tip="Legt fest, wie lange in Sekunden ein einzelnes Aufblinken eines IM-Reiter dauert - verwendet für IM-Benachrichtungen" name="ButtonFlashRate"/>
<text name="ButtonFlashRateText">

View File

@ -2779,7 +2779,8 @@
<menu_item_check
label="UI"
name="ToggleUI"
shortcut="control|alt|F1">
shortcut="control|alt|F1"
shortcut_linux="control|shift|F1">
<menu_item_check.on_check
function="Advanced.CheckFeature"
parameter="ui" />
@ -2790,7 +2791,8 @@
<menu_item_check
label="Selected"
name="Selected"
shortcut="control|alt|F2">
shortcut="control|alt|F2"
shortcut_linux="control|shift|F2">
<menu_item_check.on_check
function="Advanced.CheckFeature"
parameter="selected" />
@ -2801,7 +2803,8 @@
<menu_item_check
label="Highlighted"
name="Highlighted"
shortcut="control|alt|F3">
shortcut="control|alt|F3"
shortcut_linux="control|shift|F3">
<menu_item_check.on_check
function="Advanced.CheckFeature"
parameter="highlighted" />
@ -2812,7 +2815,8 @@
<menu_item_check
label="Dynamic Textures"
name="Dynamic Textures"
shortcut="control|alt|F4">
shortcut="control|alt|F4"
shortcut_linux="control|shift|F4">
<menu_item_check.on_check
function="Advanced.CheckFeature"
parameter="dynamic textures" />
@ -2823,7 +2827,8 @@
<menu_item_check
label="Foot Shadows"
name="Foot Shadows"
shortcut="control|alt|F5">
shortcut="control|alt|F5"
shortcut_linux="control|shift|F5">
<menu_item_check.on_check
function="Advanced.CheckFeature"
parameter="foot shadows" />
@ -2834,7 +2839,8 @@
<menu_item_check
label="Fog"
name="Fog"
shortcut="control|alt|F6">
shortcut="control|alt|F6"
shortcut_linux="control|shift|F6">
<menu_item_check.on_check
function="Advanced.CheckFeature"
parameter="fog" />
@ -2845,7 +2851,8 @@
<menu_item_check
label="Test FRInfo"
name="Test FRInfo"
shortcut="control|alt|F8">
shortcut="control|alt|F8"
shortcut_linux="control|shift|F8">
<menu_item_check.on_check
function="Advanced.CheckFeature"
parameter="fr info" />
@ -2856,7 +2863,8 @@
<menu_item_check
label="Flexible Objects"
name="Flexible Objects"
shortcut="control|alt|F9">
shortcut="control|alt|F9"
shortcut_linux="control|shift|F9">
<menu_item_check.on_check
function="Advanced.CheckFeature"
parameter="flexible" />

View File

@ -498,6 +498,16 @@
name="FSLegacyNotificationWellRequiresRestart">
(requires restart)
</text>
<check_box
control_name="FSRemapLinuxShortcuts"
height="16"
label="Remap shortcuts already used by Linux (Linux only; requires restart)"
layout="topleft"
left="5"
name="FSRemapLinuxShortcuts"
tool_tip="If enabled, shortcuts that are already used by the Linux operating system (such as CTRL-ALT-Fx) will be remapped."
top_pad="5"
width="256" />
<slider
control_name="FlashCount"