Make VR->keyboard bindings appear in .ini on startup
This commit is contained in:
@@ -274,6 +274,27 @@ OverlayController::OverlayController( bool desktopMode,
|
|||||||
QQmlEngine::setObjectOwnership( obj, QQmlEngine::CppOwnership );
|
QQmlEngine::setObjectOwnership( obj, QQmlEngine::CppOwnership );
|
||||||
return obj;
|
return obj;
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
// Force keyboard shortcut settings to appear in config file.
|
||||||
|
constexpr auto settingsKeyboardName = "keyboardShortcuts";
|
||||||
|
appSettings()->beginGroup( settingsKeyboardName );
|
||||||
|
|
||||||
|
constexpr auto defaultDiscordMuteBindings = "^>m";
|
||||||
|
if ( appSettings()->value( "keyboardOne", "" ) == "" )
|
||||||
|
{
|
||||||
|
appSettings()->setValue( "keyboardOne", defaultDiscordMuteBindings );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( appSettings()->value( "keyboardTwo", "" ) == "" )
|
||||||
|
{
|
||||||
|
appSettings()->setValue( "keyboardTwo", defaultDiscordMuteBindings );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( appSettings()->value( "keyboardThree", "" ) == "" )
|
||||||
|
{
|
||||||
|
appSettings()->setValue( "keyboardThree", defaultDiscordMuteBindings );
|
||||||
|
}
|
||||||
|
appSettings()->endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
OverlayController::~OverlayController()
|
OverlayController::~OverlayController()
|
||||||
@@ -595,14 +616,9 @@ void OverlayController::processKeyboardBindings()
|
|||||||
|
|
||||||
if ( m_actions.keyboardOne() )
|
if ( m_actions.keyboardOne() )
|
||||||
{
|
{
|
||||||
constexpr auto defaultDiscordMuteBinding = "^>m";
|
|
||||||
|
|
||||||
appSettings()->beginGroup( settingsKeyboardName );
|
appSettings()->beginGroup( settingsKeyboardName );
|
||||||
const auto commands
|
const auto commands
|
||||||
= appSettings()
|
= appSettings()->value( "keyboardOne" ).toString().toStdString();
|
||||||
->value( "keyboardOne", defaultDiscordMuteBinding )
|
|
||||||
.toString()
|
|
||||||
.toStdString();
|
|
||||||
appSettings()->endGroup();
|
appSettings()->endGroup();
|
||||||
|
|
||||||
sendStringAsInput( commands );
|
sendStringAsInput( commands );
|
||||||
|
|||||||
Reference in New Issue
Block a user