vbox5/6: pass extra mouse buttons to VM

Fixes #4120
This commit is contained in:
Johannes Schlatow 2021-04-29 16:04:19 +02:00 committed by Norman Feske
parent 8a4b52d9e3
commit bf3ad3baff
3 changed files with 9 additions and 10 deletions

View File

@ -167,7 +167,9 @@ void GenodeConsole::_handle_input()
auto curr_mouse_button_bits = [&] () { auto curr_mouse_button_bits = [&] () {
return (_key_status[Input::BTN_LEFT] ? MouseButtonState_LeftButton : 0) return (_key_status[Input::BTN_LEFT] ? MouseButtonState_LeftButton : 0)
| (_key_status[Input::BTN_RIGHT] ? MouseButtonState_RightButton : 0) | (_key_status[Input::BTN_RIGHT] ? MouseButtonState_RightButton : 0)
| (_key_status[Input::BTN_MIDDLE] ? MouseButtonState_MiddleButton : 0); | (_key_status[Input::BTN_MIDDLE] ? MouseButtonState_MiddleButton : 0)
| (_key_status[Input::BTN_SIDE] ? MouseButtonState_XButton1 : 0)
| (_key_status[Input::BTN_EXTRA] ? MouseButtonState_XButton2 : 0);
}; };
unsigned const old_mouse_button_bits = curr_mouse_button_bits(); unsigned const old_mouse_button_bits = curr_mouse_button_bits();

View File

@ -132,13 +132,6 @@ class GenodeConsole : public Console {
bool _key_status[Input::KEY_MAX + 1]; bool _key_status[Input::KEY_MAX + 1];
static bool _mouse_button(Input::Keycode keycode)
{
return keycode == Input::BTN_LEFT
|| keycode == Input::BTN_RIGHT
|| keycode == Input::BTN_MIDDLE;
}
void _handle_input(); void _handle_input();
void _handle_mode_change(); void _handle_mode_change();
void _handle_cb_rom_change(); void _handle_cb_rom_change();

View File

@ -42,7 +42,9 @@ struct Input_adapter
{ {
return keycode == Input::BTN_LEFT return keycode == Input::BTN_LEFT
|| keycode == Input::BTN_RIGHT || keycode == Input::BTN_RIGHT
|| keycode == Input::BTN_MIDDLE; || keycode == Input::BTN_MIDDLE
|| keycode == Input::BTN_SIDE
|| keycode == Input::BTN_EXTRA;
} }
void handle_input_event(Input::Event const &); void handle_input_event(Input::Event const &);
@ -105,7 +107,9 @@ void Input_adapter::Mouse::handle_input_event(Input::Event const &ev)
auto curr_mouse_button_bits = [&] () { auto curr_mouse_button_bits = [&] () {
return (_key_status[Input::BTN_LEFT] ? MouseButtonState_LeftButton : 0) return (_key_status[Input::BTN_LEFT] ? MouseButtonState_LeftButton : 0)
| (_key_status[Input::BTN_RIGHT] ? MouseButtonState_RightButton : 0) | (_key_status[Input::BTN_RIGHT] ? MouseButtonState_RightButton : 0)
| (_key_status[Input::BTN_MIDDLE] ? MouseButtonState_MiddleButton : 0); | (_key_status[Input::BTN_MIDDLE] ? MouseButtonState_MiddleButton : 0)
| (_key_status[Input::BTN_SIDE] ? MouseButtonState_XButton1 : 0)
| (_key_status[Input::BTN_EXTRA] ? MouseButtonState_XButton2 : 0);
}; };
unsigned const old_mouse_button_bits = curr_mouse_button_bits(); unsigned const old_mouse_button_bits = curr_mouse_button_bits();