@@ -748,6 +748,10 @@ void Keyboard::update( void )
748748void Keyboard::resetKeys ( void )
749749{
750750
751+ // TheSuperHackers @fix Caball009 13/12/2025 Fix bug where game remains in waypoint mode
752+ // because the key up state for the alt key is not detected after alt tab.
753+ refreshAltKeys ();
754+
751755 memset ( m_keys, 0 , sizeof ( m_keys ) );
752756 memset ( m_keyStatus, 0 , sizeof ( m_keyStatus ) );
753757 m_modifiers = KEY_STATE_NONE;
@@ -758,6 +762,25 @@ void Keyboard::resetKeys( void )
758762
759763}
760764
765+ // -------------------------------------------------------------------------------------------------
766+ // Refresh the state of the alt keys, necessary after alt tab
767+ // -------------------------------------------------------------------------------------------------
768+ void Keyboard::refreshAltKeys () const
769+ {
770+ if (BitIsSet (m_keyStatus[KEY_LALT].state , KEY_STATE_DOWN))
771+ {
772+ GameMessage* msg = TheMessageStream->appendMessage (GameMessage::MSG_RAW_KEY_UP);
773+ msg->appendIntegerArgument (KEY_LALT);
774+ msg->appendIntegerArgument (KEY_STATE_UP);
775+ }
776+ if (BitIsSet (m_keyStatus[KEY_RALT].state , KEY_STATE_DOWN))
777+ {
778+ GameMessage* msg = TheMessageStream->appendMessage (GameMessage::MSG_RAW_KEY_UP);
779+ msg->appendIntegerArgument (KEY_RALT);
780+ msg->appendIntegerArgument (KEY_STATE_UP);
781+ }
782+ }
783+
761784// -------------------------------------------------------------------------------------------------
762785/* * get the first key in our current state of the keyboard */
763786// -------------------------------------------------------------------------------------------------
0 commit comments