keyboard & mouse forwarding
This commit is contained in:
committed by
Patrick Nicolas
parent
efde4bf247
commit
2063cae3ae
@@ -391,6 +391,47 @@ struct inputs
|
||||
std::vector<input_value> values;
|
||||
};
|
||||
|
||||
struct hid
|
||||
{
|
||||
struct button_down
|
||||
{
|
||||
uint8_t button;
|
||||
};
|
||||
|
||||
struct button_up
|
||||
{
|
||||
uint8_t button;
|
||||
};
|
||||
|
||||
struct mouse_move
|
||||
{
|
||||
float x;
|
||||
float y;
|
||||
};
|
||||
|
||||
struct mouse_scroll
|
||||
{
|
||||
float h;
|
||||
float v;
|
||||
};
|
||||
|
||||
struct key_down
|
||||
{
|
||||
uint8_t key;
|
||||
};
|
||||
|
||||
struct key_up
|
||||
{
|
||||
uint8_t key;
|
||||
};
|
||||
|
||||
using input_t = std::variant<button_down, button_up, mouse_move, mouse_scroll, key_down, key_up>;
|
||||
struct input
|
||||
{
|
||||
input_t input_data;
|
||||
};
|
||||
};
|
||||
|
||||
struct timesync_response
|
||||
{
|
||||
XrTime query;
|
||||
@@ -472,6 +513,7 @@ struct stop_application
|
||||
uint32_t id;
|
||||
};
|
||||
|
||||
// when changing this, also make sure there are handlers in wivrn_session, etc. or compilation will fail
|
||||
using packets = std::variant<
|
||||
crypto_handshake,
|
||||
pin_check_1,
|
||||
@@ -497,6 +539,7 @@ using packets = std::variant<
|
||||
start_app,
|
||||
get_running_applications,
|
||||
set_active_application,
|
||||
hid::input,
|
||||
stop_application>;
|
||||
} // namespace from_headset
|
||||
|
||||
@@ -671,6 +714,7 @@ struct tracking_control
|
||||
right_hand,
|
||||
face,
|
||||
generic_tracker,
|
||||
hid_input,
|
||||
battery,
|
||||
microphone,
|
||||
|
||||
|
||||
@@ -86,6 +86,11 @@ public:
|
||||
{
|
||||
return fd != -1;
|
||||
}
|
||||
|
||||
operator int() const
|
||||
{
|
||||
return fd;
|
||||
}
|
||||
};
|
||||
|
||||
class UDP : public fd_base
|
||||
|
||||
Reference in New Issue
Block a user