add led state pseudo encoding
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
457798b0e3
commit
aa2ac23130
@ -61,6 +61,7 @@ const (
|
||||
EncQEMUPointerMotionChangePseudo EncodingType = -257
|
||||
EncQEMUExtendedKeyEventPseudo EncodingType = -258
|
||||
EncTightPng EncodingType = -260
|
||||
EncLedStatePseudo EncodingType = -261
|
||||
EncDesktopNamePseudo EncodingType = -307
|
||||
EncExtendedDesktopSizePseudo EncodingType = -308
|
||||
EncXvpPseudo EncodingType = -309
|
||||
|
24
encoding_ledstate.go
Normal file
24
encoding_ledstate.go
Normal file
@ -0,0 +1,24 @@
|
||||
package rfb
|
||||
|
||||
import "encoding/binary"
|
||||
|
||||
type LedStatePseudoEncoding struct {
|
||||
State uint8
|
||||
}
|
||||
|
||||
func (*LedStatePseudoEncoding) Supported(Conn) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (*LedStatePseudoEncoding) Type() EncodingType { return EncLedStatePseudo }
|
||||
|
||||
func (enc *LedStatePseudoEncoding) Read(c Conn, rect *Rectangle) error {
|
||||
if err := binary.Read(c, binary.BigEndian, &enc.State); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (enc *LedStatePseudoEncoding) Write(c Conn, rect *Rectangle) error {
|
||||
return binary.Write(c, binary.BigEndian, []byte{enc.State})
|
||||
}
|
Loading…
Reference in New Issue
Block a user