A game about forced loneliness, made by TACStudios
1namespace UnityEngine.InputSystem.LowLevel
2{
3 /// <summary>
4 /// Interface for <see cref="InputDevice"/> classes that can receive text input events.
5 /// </summary>
6 /// <remarks>
7 /// This interface should be implemented by devices that are meant to receive text
8 /// input through <see cref="TextEvent"/>.
9 /// </remarks>
10 /// <seealso cref="TextEvent"/>
11 /// <seealso cref="IMECompositionEvent"/>
12 public interface ITextInputReceiver
13 {
14 /// <summary>
15 /// A single, fully-formed Unicode character has been typed on the device.
16 /// </summary>
17 /// <param name="character">Character that was typed. Note that in case the character is part of
18 /// a surrogate pair, this method is called first with the high surrogate and then with the
19 /// low surrogate character.</param>
20 /// <remarks>
21 /// This method is called on a device when a <see cref="TextEvent"/> is received
22 /// for the device. <paramref name="character"/> is the <see cref="TextEvent.character"/>
23 /// from the event.
24 ///
25 /// Note that this method will be called *twice* for a single <see cref="TextEvent"/>
26 /// in case the given UTF-32 (encoding in the event) needs to be represented as UTF-16
27 /// (encoding of <c>char</c> in C#) surrogate.
28 /// </remarks>
29 void OnTextInput(char character);
30
31 /// <summary>
32 /// Called when an IME composition is in-progress or finished.
33 /// </summary>
34 /// <param name="compositionString">The current composition.</param>
35 /// <seealso cref="IMECompositionEvent"/>
36 /// <seealso cref="Keyboard.onIMECompositionChange"/>
37 /// <remarks>
38 /// The method will be repeatedly called with the current string while composition is in progress.
39 /// Once composition finishes, the method will be called one more time with a blank composition
40 /// string.
41 /// </remarks>
42 void OnIMECompositionChanged(IMECompositionString compositionString);
43 }
44}