Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/KeyboardShortcutsWindow.cpp
void KeyboardShortcutsWindow::OnShortcutChange(int row, int column)
    {
        MCORE_UNUSED(column);

        MysticQt::KeyboardShortcutManager* shortcutManager = GetMainWindow()->GetShortcutManager();

        // get access to the group
        MysticQt::KeyboardShortcutManager::Group* group = GetCurrentGroup();

        // get access to the action
        MysticQt::KeyboardShortcutManager::Action* action = group->GetAction(row);

        ShortcutReceiverDialog shortcutWindow(this, action, group);
        m_shortcutReceiverDialog = &shortcutWindow;
        if (shortcutWindow.exec() == QDialog::Accepted)
        {
            // handle conflicts
            if (shortcutWindow.m_conflictDetected)
            {
                shortcutWindow.m_conflictAction->m_qaction->setShortcut({});
            }

            // adjust the shortcut action
            action->m_qaction->setShortcut(shortcutWindow.m_key);

            // save the new shortcuts
            QSettings settings(FromStdString(AZStd::string(GetManager()->GetAppDataFolder() + "EMStudioKeyboardShortcuts.cfg")), QSettings::IniFormat, this);
            shortcutManager->Save(&settings);

            // reinit the window
            ReInit();
        }
        m_shortcutReceiverDialog = nullptr;
    }
// called after any change of a shortcut
called after any change of a shortcut
called after any change of a shortcut
void KeyboardShortcutsWindow::OnShortcutChange(int row, int column)
    {
        MCORE_UNUSED(column);
        MysticQt::KeyboardShortcutManager* shortcutManager = GetMainWindow()->GetShortcutManager();
        MysticQt::KeyboardShortcutManager::Group* group = GetCurrentGroup();
        MysticQt::KeyboardShortcutManager::Action* action = group->GetAction(row);
        ShortcutReceiverDialog shortcutWindow(this, action, group);
        m_shortcutReceiverDialog = &shortcutWindow;
        if (shortcutWindow.exec() == QDialog::Accepted)
        {
            if (shortcutWindow.m_conflictDetected)
            {
                shortcutWindow.m_conflictAction->m_qaction->setShortcut({});
            }
            action->m_qaction->setShortcut(shortcutWindow.m_key);
            QSettings settings(FromStdString(AZStd::string(GetManager()->GetAppDataFolder() + "EMStudioKeyboardShortcuts.cfg")), QSettings::IniFormat, this);
            shortcutManager->Save(&settings);
            ReInit();
        }
        m_shortcutReceiverDialog = nullptr;
    }
void KeyboardShortcutsWindow :: OnShortcutChange ( int row , int column ) { MCORE_UNUSED ( column ) ; MysticQt :: KeyboardShortcutManager * shortcutManager = GetMainWindow ( ) -> GetShortcutManager ( ) ; MysticQt :: KeyboardShortcutManager :: Group * group = GetCurrentGroup ( ) ; MysticQt :: KeyboardShortcutManager :: Action * action = group -> GetAction ( row ) ; ShortcutReceiverDialog shortcutWindow ( this , action , group ) ; m_shortcutReceiverDialog = & shortcutWindow ; if ( shortcutWindow . exec ( ) == QDialog :: Accepted ) { if ( shortcutWindow . m_conflictDetected ) { shortcutWindow . m_conflictAction -> m_qaction -> setShortcut ( { } ) ; } action -> m_qaction -> setShortcut ( shortcutWindow . m_key ) ; QSettings settings ( FromStdString ( AZStd :: string ( GetManager ( ) -> GetAppDataFolder ( ) + " " ) ) , QSettings :: IniFormat , this ) ; shortcutManager -> Save ( & settings ) ; ReInit ( ) ; } m_shortcutReceiverDialog = nullptr ; }
called after any change of a shortcut
called after any change of a shortcut
// get access to the group // get access to the action // handle conflicts // adjust the shortcut action // save the new shortcuts // reinit the window