1 | /*
|
---|
2 | * synergy -- mouse and keyboard sharing utility
|
---|
3 | * Copyright (C) 2002 Chris Schoeneman
|
---|
4 | *
|
---|
5 | * This package is free software; you can redistribute it and/or
|
---|
6 | * modify it under the terms of the GNU General Public License
|
---|
7 | * found in the file COPYING that should have accompanied this file.
|
---|
8 | *
|
---|
9 | * This package is distributed in the hope that it will be useful,
|
---|
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
12 | * GNU General Public License for more details.
|
---|
13 | */
|
---|
14 |
|
---|
15 | #include "CClientProxy1_1.h"
|
---|
16 | #include "CProtocolUtil.h"
|
---|
17 | #include "CLog.h"
|
---|
18 | #include <cstring>
|
---|
19 |
|
---|
20 | //
|
---|
21 | // CClientProxy1_1
|
---|
22 | //
|
---|
23 |
|
---|
24 | CClientProxy1_1::CClientProxy1_1(const CString& name, IStream* stream) :
|
---|
25 | CClientProxy1_0(name, stream)
|
---|
26 | {
|
---|
27 | // do nothing
|
---|
28 | }
|
---|
29 |
|
---|
30 | CClientProxy1_1::~CClientProxy1_1()
|
---|
31 | {
|
---|
32 | // do nothing
|
---|
33 | }
|
---|
34 |
|
---|
35 | void
|
---|
36 | CClientProxy1_1::keyDown(KeyID key, KeyModifierMask mask, KeyButton button)
|
---|
37 | {
|
---|
38 | LOG((CLOG_DEBUG1 "send key down to \"%s\" id=%d, mask=0x%04x, button=0x%04x", getName().c_str(), key, mask, button));
|
---|
39 | CProtocolUtil::writef(getStream(), kMsgDKeyDown, key, mask, button);
|
---|
40 | }
|
---|
41 |
|
---|
42 | void
|
---|
43 | CClientProxy1_1::keyRepeat(KeyID key, KeyModifierMask mask,
|
---|
44 | SInt32 count, KeyButton button)
|
---|
45 | {
|
---|
46 | LOG((CLOG_DEBUG1 "send key repeat to \"%s\" id=%d, mask=0x%04x, count=%d, button=0x%04x", getName().c_str(), key, mask, count, button));
|
---|
47 | CProtocolUtil::writef(getStream(), kMsgDKeyRepeat, key, mask, count, button);
|
---|
48 | }
|
---|
49 |
|
---|
50 | void
|
---|
51 | CClientProxy1_1::keyUp(KeyID key, KeyModifierMask mask, KeyButton button)
|
---|
52 | {
|
---|
53 | LOG((CLOG_DEBUG1 "send key up to \"%s\" id=%d, mask=0x%04x, button=0x%04x", getName().c_str(), key, mask, button));
|
---|
54 | CProtocolUtil::writef(getStream(), kMsgDKeyUp, key, mask, button);
|
---|
55 | }
|
---|