diff options
Diffstat (limited to 'remoting/client/plugin/pepper_input_handler.cc')
-rw-r--r-- | remoting/client/plugin/pepper_input_handler.cc | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/remoting/client/plugin/pepper_input_handler.cc b/remoting/client/plugin/pepper_input_handler.cc index 96e8149..40f299e 100644 --- a/remoting/client/plugin/pepper_input_handler.cc +++ b/remoting/client/plugin/pepper_input_handler.cc @@ -16,7 +16,27 @@ PepperInputHandler::~PepperInputHandler() { } void PepperInputHandler::Initialize() { - // TODO(garykac): Implement this. +} + +void PepperInputHandler::HandleMouseMoveEvent(const PP_Event_Mouse& event) { + SendMouseMoveEvent(static_cast<int>(event.x), + static_cast<int>(event.y)); +} + +void PepperInputHandler::HandleMouseButtonEvent(bool button_down, + const PP_Event_Mouse& event) { + MouseButton button = MouseButtonUndefined; + if (event.button == PP_EVENT_MOUSEBUTTON_LEFT) { + button = MouseButtonLeft; + } else if (event.button == PP_EVENT_MOUSEBUTTON_MIDDLE) { + button = MouseButtonMiddle; + } else if (event.button == PP_EVENT_MOUSEBUTTON_RIGHT) { + button = MouseButtonRight; + } + + if (button != MouseButtonUndefined) { + SendMouseButtonEvent(button_down, button); + } } } // namespace remoting |