backend: forward keyboard and mouse input from client
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
namespace InputEvent;
|
||||
|
||||
|
||||
enum KeyAction: byte {
|
||||
DOWN,
|
||||
UP,
|
||||
}
|
||||
|
||||
|
||||
table MouseMovement {
|
||||
movement_x: int16;
|
||||
movement_y: int16;
|
||||
}
|
||||
|
||||
enum MouseButton: byte {
|
||||
LEFT,
|
||||
MIDDLE,
|
||||
RIGHT,
|
||||
X1,
|
||||
X2
|
||||
}
|
||||
|
||||
table MouseInput {
|
||||
button: MouseButton;
|
||||
button_action: KeyAction;
|
||||
}
|
||||
|
||||
|
||||
struct ModifierState {
|
||||
shift: bool;
|
||||
ctrl: bool;
|
||||
alt: bool;
|
||||
meta: bool;
|
||||
}
|
||||
|
||||
table KeyboardInput {
|
||||
key_code: int16;
|
||||
key_action: KeyAction;
|
||||
modifiers: ModifierState;
|
||||
}
|
||||
|
||||
union Input {
|
||||
Keyboard:KeyboardInput,
|
||||
MouseMovement:MouseMovement,
|
||||
MouseInput:MouseInput,
|
||||
}
|
||||
|
||||
table InputEvent {
|
||||
input: Input;
|
||||
}
|
||||
|
||||
root_type InputEvent;
|
||||
|
||||
Reference in New Issue
Block a user