SoftwareKeyboardCalcEx.cs 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. using System.Runtime.InteropServices;
  2. namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard
  3. {
  4. /// <summary>
  5. /// A structure with configuration options of the software keyboard when starting a new input request in inline mode.
  6. /// This is the extended version of the structure with extended appear options.
  7. /// </summary>
  8. [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
  9. struct SoftwareKeyboardCalcEx
  10. {
  11. /// <summary>
  12. /// This struct was built following Switchbrew's specs, but this size (larger) is also found in real games.
  13. /// It's assumed that this is padding at the end of this struct, because all members seem OK.
  14. /// </summary>
  15. public const int AlternativeSize = 1256;
  16. public const int InputTextLength = 505;
  17. public uint Unknown;
  18. /// <summary>
  19. /// The size of the Calc struct, as reported by the process communicating with the applet.
  20. /// </summary>
  21. public ushort Size;
  22. public byte Unknown1;
  23. public byte Unknown2;
  24. /// <summary>
  25. /// Configuration flags. Each bit in the bitfield enabled a different operation of the keyboard
  26. /// using the data provided with the Calc structure.
  27. /// </summary>
  28. public KeyboardCalcFlags Flags;
  29. /// <summary>
  30. /// The original parameters used when initializing the keyboard applet.
  31. /// Flag: 0x1
  32. /// </summary>
  33. public SoftwareKeyboardInitialize Initialize;
  34. /// <summary>
  35. /// The audio volume used by the sound effects of the keyboard.
  36. /// Flag: 0x2
  37. /// </summary>
  38. public float Volume;
  39. /// <summary>
  40. /// The initial position of the text cursor (caret) in the provided input text.
  41. /// Flag: 0x10
  42. /// </summary>
  43. public int CursorPos;
  44. /// <summary>
  45. /// Appearance configurations for the on-screen keyboard.
  46. /// </summary>
  47. public SoftwareKeyboardAppearEx Appear;
  48. /// <summary>
  49. /// The initial input text to be used by the software keyboard.
  50. /// Flag: 0x8
  51. /// </summary>
  52. [MarshalAs(UnmanagedType.ByValTStr, SizeConst = InputTextLength + 1)]
  53. public string InputText;
  54. /// <summary>
  55. /// When set, the strings communicated by software keyboard will be encoded as UTF-8 instead of UTF-16.
  56. /// Flag: 0x20
  57. /// </summary>
  58. [MarshalAs(UnmanagedType.I1)]
  59. public bool UseUtf8;
  60. public byte Unknown3;
  61. /// <summary>
  62. /// [5.0.0+] Enable the backspace key in the software keyboard.
  63. /// Flag: 0x8000
  64. /// </summary>
  65. [MarshalAs(UnmanagedType.I1)]
  66. public bool BackspaceEnabled;
  67. public short Unknown4;
  68. public byte Unknown5;
  69. /// <summary>
  70. /// Flag: 0x200
  71. /// </summary>
  72. [MarshalAs(UnmanagedType.I1)]
  73. public bool KeytopAsFloating;
  74. /// <summary>
  75. /// Flag: 0x100
  76. /// </summary>
  77. [MarshalAs(UnmanagedType.I1)]
  78. public bool FooterScalable;
  79. /// <summary>
  80. /// Flag: 0x100
  81. /// </summary>
  82. [MarshalAs(UnmanagedType.I1)]
  83. public bool AlphaEnabledInInputMode;
  84. /// <summary>
  85. /// Flag: 0x100
  86. /// </summary>
  87. public byte InputModeFadeType;
  88. /// <summary>
  89. /// When set, the software keyboard ignores touch input.
  90. /// Flag: 0x200
  91. /// </summary>
  92. [MarshalAs(UnmanagedType.I1)]
  93. public bool TouchDisabled;
  94. /// <summary>
  95. /// When set, the software keyboard ignores hardware keyboard commands.
  96. /// Flag: 0x800
  97. /// </summary>
  98. [MarshalAs(UnmanagedType.I1)]
  99. public bool HardwareKeyboardDisabled;
  100. public uint Unknown6;
  101. public uint Unknown7;
  102. /// <summary>
  103. /// Default value is 1.0.
  104. /// Flag: 0x200
  105. /// </summary>
  106. public float KeytopScale0;
  107. /// <summary>
  108. /// Default value is 1.0.
  109. /// Flag: 0x200
  110. /// </summary>
  111. public float KeytopScale1;
  112. public float KeytopTranslate0;
  113. public float KeytopTranslate1;
  114. /// <summary>
  115. /// Default value is 1.0.
  116. /// Flag: 0x100
  117. /// </summary>
  118. public float KeytopBgAlpha;
  119. /// <summary>
  120. /// Default value is 1.0.
  121. /// Flag: 0x100
  122. /// </summary>
  123. public float FooterBgAlpha;
  124. /// <summary>
  125. /// Default value is 1.0.
  126. /// Flag: 0x200
  127. /// </summary>
  128. public float BalloonScale;
  129. public float Unknown8;
  130. public uint Unknown9;
  131. public uint Unknown10;
  132. public uint Unknown11;
  133. /// <summary>
  134. /// [5.0.0+] Enable sound effect.
  135. /// Flag: Enable: 0x2000
  136. /// Disable: 0x4000
  137. /// </summary>
  138. public byte SeGroup;
  139. /// <summary>
  140. /// [6.0.0+] Enables the Trigger field when Trigger is non-zero.
  141. /// </summary>
  142. public byte TriggerFlag;
  143. /// <summary>
  144. /// [6.0.0+] Always set to zero.
  145. /// </summary>
  146. public byte Trigger;
  147. public byte Padding;
  148. }
  149. }