Brak opisu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

InputUserChange.cs 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. using UnityEngine.InputSystem.LowLevel;
  2. ////REVIEW: how do we handle the case where the OS may (through whatever means) recognize individual real-world users,
  3. //// associate a user account with each one, and recognize when a controller is passed from one user to the other?
  4. //// (NUI on Xbox probably gives us that scenario)
  5. namespace UnityEngine.InputSystem.Users
  6. {
  7. /// <summary>
  8. /// Indicates what type of change related to an <see cref="InputUser"/> occurred.
  9. /// </summary>
  10. /// <seealso cref="InputUser.onChange"/>
  11. public enum InputUserChange
  12. {
  13. /// <summary>
  14. /// A new user was added to the system.
  15. /// </summary>
  16. /// <seealso cref="InputUser.PerformPairingWithDevice"/>
  17. Added,
  18. /// <summary>
  19. /// An existing user was removed from the user.
  20. /// </summary>
  21. /// <remarks>
  22. /// <see cref="InputUser"/>s are only removed when explicitly requested (<see cref="InputUser.UnpairDevicesAndRemoveUser"/>).
  23. /// </remarks>
  24. /// <seealso cref="InputUser.UnpairDevicesAndRemoveUser"/>
  25. Removed,
  26. /// <summary>
  27. /// A user has had a device assigned to it.
  28. /// </summary>
  29. /// <seealso cref="InputUser.PerformPairingWithDevice"/>
  30. /// <seealso cref="InputUser.pairedDevices"/>
  31. DevicePaired,
  32. /// <summary>
  33. /// A user has had a device removed from it.
  34. /// </summary>
  35. /// <remarks>
  36. /// This is different from <see cref="DeviceLost"/> in that the removal is intentional. <see cref="DeviceLost"/>
  37. /// instead indicates that the device was removed due to causes outside of the control of the application (such
  38. /// as battery loss) whereas DeviceUnpaired indicates the device was removed from the user under the control of
  39. /// the application itself.
  40. /// </remarks>
  41. /// <seealso cref="InputUser.UnpairDevice"/>
  42. /// <seealso cref="InputUser.UnpairDevicesAndRemoveUser"/>
  43. /// <seealso cref="InputUser.pairedDevices"/>
  44. DeviceUnpaired,
  45. /// <summary>
  46. /// A device was removed while paired to the user.
  47. /// </summary>
  48. /// <remarks>
  49. /// This scenario happens on battery loss, for example.
  50. ///
  51. /// Note that there is still a <see cref="DevicePaired"/> change sent when the device is subsequently removed
  52. /// from the user.
  53. /// </remarks>
  54. /// <seealso cref="InputUser.pairedDevices"/>
  55. /// <seealso cref="InputUser.lostDevices"/>
  56. DeviceLost,
  57. ////REVIEW: should we tie this to the specific device requirement slot in the control scheme?
  58. /// <summary>
  59. /// A device that was previously lost (<see cref="DeviceLost"/>) was regained by the user.
  60. /// </summary>
  61. /// <remarks>
  62. /// This can happen, for example, when a gamepad runs out of battery and is then plugged in by wire.
  63. ///
  64. /// Note that a device may be permanently lost and instead be replaced by a different device.
  65. /// </remarks>
  66. /// <seealso cref="InputUser.lostDevices"/>
  67. DeviceRegained,
  68. ////TODO: bring documentation for these back when user management is implemented on Xbox and PS
  69. AccountChanged,
  70. AccountNameChanged,
  71. AccountSelectionInProgress,
  72. AccountSelectionCanceled,
  73. AccountSelectionComplete,
  74. ////REVIEW: send notifications about the matching status of the control scheme? maybe ControlSchemeActivated, ControlSchemeDeactivated,
  75. //// and ControlSchemeChanged?
  76. /// <summary>
  77. /// A user switched to a different control scheme.
  78. /// </summary>
  79. /// <seealso cref="InputUser.ActivateControlScheme(string)"/>
  80. /// <seealso cref="InputUser.ActivateControlScheme(InputControlScheme)"/>
  81. ControlSchemeChanged,
  82. /// <summary>
  83. /// A user's bound controls have changed, either because the bindings of the user have changed (for example,
  84. /// due to an override applied with <see cref="InputActionRebindingExtensions.ApplyBindingOverride(InputAction,InputBinding)"/>)
  85. /// or because the controls themselves may have changed configuration (every time the device of the controls receives
  86. /// an <see cref="DeviceConfigurationEvent"/>; for example, when the current keyboard layout on a <see cref="Keyboard"/>
  87. /// changes which in turn modifies the <see cref="InputControl.displayName"/>s of the keys on the keyboard).
  88. /// </summary>
  89. ControlsChanged,
  90. /*
  91. ////TODO: this is waiting for InputUserSettings
  92. /// <summary>
  93. /// A setting in the user's <see cref="InputUserSettings"/> has changed.
  94. /// </summary>
  95. /// <remarks>
  96. /// This is separate from <see cref="BindingsChanged"/> even though bindings are part of user profiles
  97. /// (<see cref="InputUserSettings.customBindings"/>). The reason is that binding changes often require
  98. /// </remarks>
  99. SettingsChanged,
  100. */
  101. }
  102. }