Skip to content

Commit

Permalink
Merge pull request #227 from teknologi-umum/feat/events-proto
Browse files Browse the repository at this point in the history
[RFC] feat: add events proto
  • Loading branch information
ronnygunawan authored Mar 10, 2022
2 parents 1f0f085 + e21e9c9 commit 64a4519
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
14 changes: 14 additions & 0 deletions proto/Spectator.Protos/enums.proto
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,17 @@ enum Language {
JAVA = 5;
PYTHON = 6;
}

enum Direction {
STOP = 0;
UP = 1;
LEFT = 2;
RIGHT = 3;
DOWN = 4;
}

enum MouseButton {
LEFT_BUTTON = 0;
RIGHT_BUTTON = 1;
MIDDLE_BUTTON = 2;
}
53 changes: 53 additions & 0 deletions proto/Spectator.Protos/events.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
syntax = "proto3";

option csharp_namespace = "Spectator.Protos.Events";

package events;

import "enums.proto";

service EventsService {
rpc MouseClick (MouseClickRequest) returns (EventReply);
rpc MouseMove (MouseMoveRequest) returns (EventReply);
rpc MouseScroll (MouseScrollRequest) returns (EventReply);
rpc Keystroke (KeystrokeRequest) returns (EventReply);
}

message MouseClickRequest {
string access_token = 1;
int32 question_number = 2;
enums.MouseButton button = 3;
int64 time = 4;
}

message MouseMoveRequest {
string access_token = 1;
int32 question_number = 2;
enums.Direction direction = 3;
int32 x_position = 4;
int32 y_position = 5;
int32 window_width = 6;
int32 window_height = 7;
int64 time = 8;
}

message MouseScrollRequest {
string access_token = 1;
int64 time = 2;
}

message KeystrokeRequest {
string access_token = 1;
int32 question_number = 2;
string key_char = 3;
bool shift = 4;
bool alt = 5;
bool control = 6;
bool meta = 7;
bool unrelated_key = 8;
int64 time = 9;
}

message EventReply {
string message = 1;
}

0 comments on commit 64a4519

Please sign in to comment.