@@ -170,22 +170,6 @@ public ConnectedDevice(int vid, int pid, string path, string name, string serial
170170
171171 internal HidStream UnderlyingInputStream { get ; set ; }
172172
173- internal static ButtonKind GetButtonKind ( byte [ ] identifier )
174- {
175- if ( identifier . Length != 2 )
176- {
177- return ButtonKind . Unknown ;
178- }
179-
180- return ( identifier [ 0 ] , identifier [ 1 ] ) switch
181- {
182- ( 0x01 , 0x00 ) => ButtonKind . Button ,
183- ( 0x01 , 0x02 ) => ButtonKind . Screen ,
184- ( 0x01 , 0x03 ) => ButtonKind . Knob ,
185- _ => ButtonKind . Unknown ,
186- } ;
187- }
188-
189173 /// <summary>
190174 /// Abstract method to get the device-specific header.
191175 /// </summary>
@@ -288,7 +272,7 @@ public bool SetKey(int keyId, byte[] image)
288272 using var stream = this . Open ( ) ;
289273 while ( remainingBytes > 0 )
290274 {
291- var sliceLength = Math . Min ( remainingBytes , ( this . PacketSize - this . KeyImageHeaderSize ) ) ;
275+ var sliceLength = Math . Min ( remainingBytes , this . PacketSize - this . KeyImageHeaderSize ) ;
292276 var bytesSent = iteration * ( this . PacketSize - this . KeyImageHeaderSize ) ;
293277
294278 // Get the device-specific header
@@ -308,7 +292,6 @@ public bool SetKey(int keyId, byte[] image)
308292 return true ;
309293 }
310294
311-
312295 /// <summary>
313296 /// Sets the key color to a specified color.
314297 /// </summary>
@@ -351,6 +334,22 @@ public bool SetKeyColor(int index, Color color)
351334 /// <returns>True if succesful, false if not.</returns>
352335 public abstract bool SetScreen ( byte [ ] image , int offset , int width , int height ) ;
353336
337+ internal static ButtonKind GetButtonKind ( byte [ ] identifier )
338+ {
339+ if ( identifier . Length != 2 )
340+ {
341+ return ButtonKind . Unknown ;
342+ }
343+
344+ return ( identifier [ 0 ] , identifier [ 1 ] ) switch
345+ {
346+ ( 0x01 , 0x00 ) => ButtonKind . Button ,
347+ ( 0x01 , 0x02 ) => ButtonKind . Screen ,
348+ ( 0x01 , 0x03 ) => ButtonKind . Knob ,
349+ _ => ButtonKind . Unknown ,
350+ } ;
351+ }
352+
354353 /// <summary>
355354 /// Handles the key press. Different devices carry different implementations.
356355 /// </summary>
0 commit comments