12
12
using osu . Framework . Graphics . UserInterface ;
13
13
using osu . Framework . Input ;
14
14
using osu . Framework . Testing ;
15
+ using osu . Framework . Testing . Input ;
15
16
using osuTK ;
16
17
using osuTK . Input ;
17
18
@@ -20,7 +21,7 @@ namespace osu.Framework.Tests.Visual.UserInterface
20
21
public partial class TestSceneTextBoxEvents : ManualInputManagerTestScene
21
22
{
22
23
private EventQueuesTextBox textBox ;
23
- private ManualTextInput textInput ;
24
+ private ManualTextInputSource textInput ;
24
25
private ManualTextInputContainer textInputContainer ;
25
26
26
27
private const string default_text = "some default text" ;
@@ -618,57 +619,12 @@ protected override void OnImeResult(string result, bool successful) =>
618
619
public partial class ManualTextInputContainer : Container
619
620
{
620
621
[ Cached ( typeof ( TextInputSource ) ) ]
621
- public readonly ManualTextInput TextInput ;
622
+ public readonly ManualTextInputSource TextInput ;
622
623
623
624
public ManualTextInputContainer ( )
624
625
{
625
626
RelativeSizeAxes = Axes . Both ;
626
- TextInput = new ManualTextInput ( ) ;
627
- }
628
- }
629
-
630
- public class ManualTextInput : TextInputSource
631
- {
632
- public void Text ( string text ) => TriggerTextInput ( text ) ;
633
-
634
- public new void TriggerImeComposition ( string text , int start , int length )
635
- {
636
- base . TriggerImeComposition ( text , start , length ) ;
637
- }
638
-
639
- public new void TriggerImeResult ( string text )
640
- {
641
- base . TriggerImeResult ( text ) ;
642
- }
643
-
644
- public override void ResetIme ( )
645
- {
646
- base . ResetIme ( ) ;
647
-
648
- // this call will be somewhat delayed in a real world scenario, but let's run it immediately for simplicity.
649
- base . TriggerImeComposition ( string . Empty , 0 , 0 ) ;
650
- }
651
-
652
- public readonly Queue < bool > ActivationQueue = new Queue < bool > ( ) ;
653
- public readonly Queue < bool > EnsureActivatedQueue = new Queue < bool > ( ) ;
654
- public readonly Queue < bool > DeactivationQueue = new Queue < bool > ( ) ;
655
-
656
- protected override void ActivateTextInput ( bool allowIme )
657
- {
658
- base . ActivateTextInput ( allowIme ) ;
659
- ActivationQueue . Enqueue ( allowIme ) ;
660
- }
661
-
662
- protected override void EnsureTextInputActivated ( bool allowIme )
663
- {
664
- base . EnsureTextInputActivated ( allowIme ) ;
665
- EnsureActivatedQueue . Enqueue ( allowIme ) ;
666
- }
667
-
668
- protected override void DeactivateTextInput ( )
669
- {
670
- base . DeactivateTextInput ( ) ;
671
- DeactivationQueue . Enqueue ( true ) ;
627
+ TextInput = new ManualTextInputSource ( ) ;
672
628
}
673
629
}
674
630
0 commit comments