keyboard & mouse forwarding
This commit is contained in:
committed by
Patrick Nicolas
parent
efde4bf247
commit
2063cae3ae
@@ -1302,3 +1302,36 @@ void scenes::stream::on_xr_event(const xr::event & event)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool scenes::stream::forward_hid_input(from_headset::hid::input_t packet)
|
||||
{
|
||||
if (not hid_forwarding)
|
||||
return false;
|
||||
network_session->send_control(from_headset::hid::input{packet});
|
||||
return true;
|
||||
}
|
||||
|
||||
bool scenes::stream::on_input_key_down(uint8_t key_code)
|
||||
{
|
||||
return forward_hid_input(from_headset::hid::key_down{key_code});
|
||||
}
|
||||
bool scenes::stream::on_input_key_up(uint8_t key_code)
|
||||
{
|
||||
return forward_hid_input(from_headset::hid::key_up{key_code});
|
||||
}
|
||||
bool scenes::stream::on_input_mouse_move(float x, float y)
|
||||
{
|
||||
return forward_hid_input(from_headset::hid::mouse_move{x, y});
|
||||
}
|
||||
bool scenes::stream::on_input_button_down(uint8_t button)
|
||||
{
|
||||
return forward_hid_input(from_headset::hid::button_down{button});
|
||||
}
|
||||
bool scenes::stream::on_input_button_up(uint8_t button)
|
||||
{
|
||||
return forward_hid_input(from_headset::hid::button_up{button});
|
||||
}
|
||||
bool scenes::stream::on_input_scroll(float h, float v)
|
||||
{
|
||||
return forward_hid_input(from_headset::hid::mouse_scroll{h, v});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user