@@ -46,79 +46,100 @@ public record Wheels : SourceActions, IEnumerable<Wheel>
4646 IEnumerator IEnumerable . GetEnumerator ( ) => Actions . GetEnumerator ( ) ;
4747 }
4848
49- [ JsonPolymorphic ( TypeDiscriminatorPropertyName = "type" ) ]
50- [ JsonDerivedType ( typeof ( Pause ) , "pause" ) ]
51- [ JsonDerivedType ( typeof ( Down ) , "keyDown" ) ]
52- [ JsonDerivedType ( typeof ( Up ) , "keyUp" ) ]
53- public abstract record Key
49+ public record None : SourceActions , IEnumerable < Input . None >
5450 {
55- public record Pause : Key
56- {
57- public long ? Duration { get ; set ; }
58- }
51+ public IList < Input . None > Actions { get ; set ; } = [ ] ;
5952
60- public record Down ( string Value ) : Key ;
53+ public void Add ( Input . None none ) => Actions . Add ( none ) ;
6154
62- public record Up ( string Value ) : Key ;
55+ public IEnumerator < Input . None > GetEnumerator ( ) => Actions . GetEnumerator ( ) ;
56+
57+ IEnumerator IEnumerable . GetEnumerator ( ) => Actions . GetEnumerator ( ) ;
6358 }
59+ }
6460
65- [ JsonPolymorphic ( TypeDiscriminatorPropertyName = "type" ) ]
66- [ JsonDerivedType ( typeof ( Pause ) , "pause" ) ]
67- [ JsonDerivedType ( typeof ( Down ) , "pointerDown" ) ]
68- [ JsonDerivedType ( typeof ( Up ) , "pointerUp" ) ]
69- [ JsonDerivedType ( typeof ( Move ) , "pointerMove" ) ]
70- public abstract record Pointer
61+ [ JsonPolymorphic ( TypeDiscriminatorPropertyName = "type" ) ]
62+ [ JsonDerivedType ( typeof ( Pause ) , "pause" ) ]
63+ [ JsonDerivedType ( typeof ( Down ) , "keyDown" ) ]
64+ [ JsonDerivedType ( typeof ( Up ) , "keyUp" ) ]
65+ public abstract record Key
66+ {
67+ public record Pause : Key
7168 {
72- public record Pause : Pointer
73- {
74- public long ? Duration { get ; set ; }
75- }
76-
77- public record Down ( int Button ) : Pointer , IPointerCommonProperties
78- {
79- public int ? Width { get ; set ; }
80- public int ? Height { get ; set ; }
81- public double ? Pressure { get ; set ; }
82- public double ? TangentialPressure { get ; set ; }
83- public int ? Twist { get ; set ; }
84- public double ? AltitudeAngle { get ; set ; }
85- public double ? AzimuthAngle { get ; set ; }
86- }
87-
88- public record Up ( int Button ) : Pointer ;
89-
90- public record Move ( int X , int Y ) : Pointer , IPointerCommonProperties
91- {
92- public int ? Duration { get ; set ; }
93-
94- public Origin ? Origin { get ; set ; }
95-
96- public int ? Width { get ; set ; }
97- public int ? Height { get ; set ; }
98- public double ? Pressure { get ; set ; }
99- public double ? TangentialPressure { get ; set ; }
100- public int ? Twist { get ; set ; }
101- public double ? AltitudeAngle { get ; set ; }
102- public double ? AzimuthAngle { get ; set ; }
103- }
69+ public long ? Duration { get ; set ; }
10470 }
10571
106- [ JsonPolymorphic ( TypeDiscriminatorPropertyName = "type" ) ]
107- [ JsonDerivedType ( typeof ( Pause ) , "pause" ) ]
108- [ JsonDerivedType ( typeof ( Scroll ) , "scroll" ) ]
109- public abstract record Wheel
72+ public record Down ( string Value ) : Key ;
73+
74+ public record Up ( string Value ) : Key ;
75+ }
76+
77+ [ JsonPolymorphic ( TypeDiscriminatorPropertyName = "type" ) ]
78+ [ JsonDerivedType ( typeof ( Pause ) , "pause" ) ]
79+ [ JsonDerivedType ( typeof ( Down ) , "pointerDown" ) ]
80+ [ JsonDerivedType ( typeof ( Up ) , "pointerUp" ) ]
81+ [ JsonDerivedType ( typeof ( Move ) , "pointerMove" ) ]
82+ public abstract record Pointer
83+ {
84+ public record Pause : Pointer
85+ {
86+ public long ? Duration { get ; set ; }
87+ }
88+
89+ public record Down ( int Button ) : Pointer , IPointerCommonProperties
90+ {
91+ public int ? Width { get ; set ; }
92+ public int ? Height { get ; set ; }
93+ public double ? Pressure { get ; set ; }
94+ public double ? TangentialPressure { get ; set ; }
95+ public int ? Twist { get ; set ; }
96+ public double ? AltitudeAngle { get ; set ; }
97+ public double ? AzimuthAngle { get ; set ; }
98+ }
99+
100+ public record Up ( int Button ) : Pointer ;
101+
102+ public record Move ( int X , int Y ) : Pointer , IPointerCommonProperties
110103 {
111- public record Pause : Wheel
112- {
113- public long ? Duration { get ; set ; }
114- }
104+ public int ? Duration { get ; set ; }
115105
116- public record Scroll ( int X , int Y , int DeltaX , int DeltaY ) : Wheel
117- {
118- public int ? Duration { get ; set ; }
106+ public Origin ? Origin { get ; set ; }
119107
120- public Origin ? Origin { get ; set ; }
121- }
108+ public int ? Width { get ; set ; }
109+ public int ? Height { get ; set ; }
110+ public double ? Pressure { get ; set ; }
111+ public double ? TangentialPressure { get ; set ; }
112+ public int ? Twist { get ; set ; }
113+ public double ? AltitudeAngle { get ; set ; }
114+ public double ? AzimuthAngle { get ; set ; }
115+ }
116+ }
117+
118+ [ JsonPolymorphic ( TypeDiscriminatorPropertyName = "type" ) ]
119+ [ JsonDerivedType ( typeof ( Pause ) , "pause" ) ]
120+ [ JsonDerivedType ( typeof ( Scroll ) , "scroll" ) ]
121+ public abstract record Wheel
122+ {
123+ public record Pause : Wheel
124+ {
125+ public long ? Duration { get ; set ; }
126+ }
127+
128+ public record Scroll ( int X , int Y , int DeltaX , int DeltaY ) : Wheel
129+ {
130+ public int ? Duration { get ; set ; }
131+
132+ public Origin ? Origin { get ; set ; }
133+ }
134+ }
135+
136+ [ JsonPolymorphic ( TypeDiscriminatorPropertyName = "type" ) ]
137+ [ JsonDerivedType ( typeof ( Pause ) , "pause" ) ]
138+ public abstract record None
139+ {
140+ public record Pause : None
141+ {
142+ public long ? Duration { get ; set ; }
122143 }
123144}
124145
0 commit comments