@@ -790,6 +790,60 @@ protected void RefreshConfigurationIfNeeded()
790790            } 
791791        } 
792792
793+         /// <summary> 
794+         /// Refresh the configuration of the control. This is used to update the control's state (e.g. Keyboard Layout or display Name of Keys). 
795+         /// </summary> 
796+         /// <remarks> 
797+         /// The system will call this method automatically whenever change is made to one of the control's configuration properties. 
798+         /// See <seealso cref="RefreshConfigurationIfNeeded"/>. 
799+         /// </remarks> 
800+         /// <example> 
801+         /// <code> 
802+         /// public class MyDevice : InputDevice 
803+         /// { 
804+         ///     public enum Orientation 
805+         ///     { 
806+         ///         Horizontal, 
807+         ///         Vertical, 
808+         ///     } 
809+         ///     private Orientation m_Orientation; 
810+         /// 
811+         ///     public Orientation orientation 
812+         ///     { 
813+         ///         get 
814+         ///         { 
815+         ///             // Call RefreshOrientation if the configuration of the device has been 
816+         ///             // invalidated since last time we initialized m_Orientation. 
817+         ///             // Calling RefreshConfigurationIfNeeded() is sufficient in most cases, RefreshConfiguration() forces the refresh. 
818+         ///             RefreshConfiguration(); 
819+         ///             return m_Orientation; 
820+         ///         } 
821+         ///     } 
822+         ///     protected override void RefreshConfiguration() 
823+         ///     { 
824+         ///         // Fetch the current orientation from the backend. How you do this 
825+         ///         // depends on your device. Using DeviceCommands is one way. 
826+         ///         var fetchOrientationCommand = new FetchOrientationCommand(); 
827+         ///         ExecuteCommand(ref fetchOrientationCommand); 
828+         ///         m_Orientation = fetchOrientation; 
829+         /// 
830+         ///         // Reflect the orientation on the device. 
831+         ///         switch (m_Orientation) 
832+         ///         { 
833+         ///             case Orientation.Vertical: 
834+         ///                 InputSystem.RemoveDeviceUsage(this, s_Horizontal); 
835+         ///                 InputSystem.AddDeviceUsage(this, s_Vertical); 
836+         ///                 break; 
837+         /// 
838+         ///             case Orientation.Horizontal: 
839+         ///                 InputSystem.RemoveDeviceUsage(this, s_Vertical); 
840+         ///                 InputSystem.AddDeviceUsage(this, s_Horizontal); 
841+         ///                 break; 
842+         ///         } 
843+         ///     } 
844+         /// } 
845+         /// </code> 
846+         /// </example> 
793847        protected  virtual  void  RefreshConfiguration ( ) 
794848        { 
795849        } 
0 commit comments