-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMouseMoveMessage.h
More file actions
44 lines (34 loc) · 975 Bytes
/
Copy pathMouseMoveMessage.h
File metadata and controls
44 lines (34 loc) · 975 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: MouseMoveMessage.h
* Author: kubatek94
*
* Created on 19 March 2016, 15:40
*/
#ifndef MOUSEMOVEMESSAGE_H
#define MOUSEMOVEMESSAGE_H
#include <iostream>
#include "Message.h"
namespace Message {
class MouseMoveMessage : public Message {
public:
MouseMoveMessage() : Message(Message::Type::MOUSE_MOVE, 2) { }
MouseMoveMessage(jbyte dx, jbyte dy) : Message(Message::Type::MOUSE_MOVE, 2) {
setDelta(dx, dy);
}
void setDelta(jbyte dx, jbyte dy) {
buffer.put(dx);
buffer.put(dy);
}
void action(VirtualInput& mouse) {
jbyte dx = buffer.get(2);
jbyte dy = buffer.get(3);
mouse.move(dy, dx);
}
};
}
#endif /* MOUSEMOVEMESSAGE_H */