No Description
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.

SetIMECursorPositionCommand.cs 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. using System.Runtime.InteropServices;
  3. using UnityEngine.InputSystem.Utilities;
  4. namespace UnityEngine.InputSystem.LowLevel
  5. {
  6. /// <summary>
  7. /// Sets the position for IME dialogs. This is in pixels, from the upper left corner going down and to the right.
  8. /// </summary>
  9. [StructLayout(LayoutKind.Explicit, Size = kSize)]
  10. public unsafe struct SetIMECursorPositionCommand : IInputDeviceCommandInfo
  11. {
  12. public static FourCC Type { get { return new FourCC('I', 'M', 'E', 'P'); } }
  13. internal const int kSize = InputDeviceCommand.kBaseCommandSize + (sizeof(float) * 2);
  14. [FieldOffset(0)]
  15. public InputDeviceCommand baseCommand;
  16. public Vector2 position
  17. {
  18. get { return m_Position; }
  19. }
  20. [FieldOffset(InputDeviceCommand.kBaseCommandSize)]
  21. Vector2 m_Position;
  22. public FourCC typeStatic
  23. {
  24. get { return Type; }
  25. }
  26. public static SetIMECursorPositionCommand Create(Vector2 cursorPosition)
  27. {
  28. return new SetIMECursorPositionCommand
  29. {
  30. baseCommand = new InputDeviceCommand(Type, kSize),
  31. m_Position = cursorPosition
  32. };
  33. }
  34. }
  35. }