Allow for scroll wheel injection (#23)
* Working on proper resizing of AA * allow for custom aspect ratios * A mess of code to support sending input events from dash * Restructuring input injection to be much nicer * Code Cleanup * Allow for scroll wheel injection
This commit is contained in:
parent
658005da61
commit
efb9d8bc6f
@ -38,7 +38,7 @@ class InputService:
|
||||
public:
|
||||
InputService(boost::asio::io_service& ioService, aasdk::messenger::IMessenger::Pointer messenger, projection::IInputDevice::Pointer inputDevice);
|
||||
|
||||
void sendButtonPress(aasdk::proto::enums::ButtonCode::Enum buttonCode);
|
||||
void sendButtonPress(aasdk::proto::enums::ButtonCode::Enum buttonCode, projection::WheelDirection wheelDirection = projection::WheelDirection::NONE);
|
||||
void start() override;
|
||||
void stop() override;
|
||||
void fillFeatures(aasdk::proto::messages::ServiceDiscoveryResponse& response) override;
|
||||
|
@ -41,7 +41,7 @@ public:
|
||||
void setOpacity(unsigned int alpha);
|
||||
void resize();
|
||||
void setNightMode(bool nightMode);
|
||||
void sendButtonPress(aasdk::proto::enums::ButtonCode::Enum buttonCode);
|
||||
void sendButtonPress(aasdk::proto::enums::ButtonCode::Enum buttonCode, projection::WheelDirection wheelDirection = projection::WheelDirection::NONE);
|
||||
void sendKeyEvent(QKeyEvent* event);
|
||||
static QRect mapActiveAreaToGlobal(QWidget* activeArea);
|
||||
#ifdef USE_OMX
|
||||
|
@ -163,12 +163,19 @@ void InputService::onButtonEvent(const projection::ButtonEvent& event)
|
||||
});
|
||||
}
|
||||
|
||||
void InputService::sendButtonPress(aasdk::proto::enums::ButtonCode::Enum buttonCode)
|
||||
void InputService::sendButtonPress(aasdk::proto::enums::ButtonCode::Enum buttonCode, projection::WheelDirection wheelDirection)
|
||||
{
|
||||
OPENAUTO_LOG(error) << "[InputService] injecting button press";
|
||||
OPENAUTO_LOG(info) << "[InputService] injecting button press";
|
||||
if(buttonCode == aasdk::proto::enums::ButtonCode::SCROLL_WHEEL)
|
||||
{
|
||||
onButtonEvent({projection::ButtonEventType::NONE, wheelDirection, buttonCode});
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
onButtonEvent({projection::ButtonEventType::PRESS, projection::WheelDirection::NONE, buttonCode});
|
||||
onButtonEvent({projection::ButtonEventType::RELEASE, projection::WheelDirection::NONE, buttonCode});
|
||||
}
|
||||
}
|
||||
|
||||
void InputService::onTouchEvent(const projection::TouchEvent& event)
|
||||
|
@ -228,12 +228,12 @@ void ServiceFactory::setNightMode(bool nightMode)
|
||||
}
|
||||
}
|
||||
|
||||
void ServiceFactory::sendButtonPress(aasdk::proto::enums::ButtonCode::Enum buttonCode)
|
||||
void ServiceFactory::sendButtonPress(aasdk::proto::enums::ButtonCode::Enum buttonCode, projection::WheelDirection wheelDirection)
|
||||
{
|
||||
if(std::shared_ptr<InputService> inputService = inputService_.lock())
|
||||
{
|
||||
|
||||
inputService->sendButtonPress(buttonCode);
|
||||
inputService->sendButtonPress(buttonCode, wheelDirection);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user