mirror of
https://gitee.com/openharmony/accessibility
synced 2024-11-27 00:51:07 +00:00
commit
7b48f82407
@ -23,6 +23,7 @@
|
||||
#include "accessibility_event_transmission.h"
|
||||
#include "accessibility_mouse_key.h"
|
||||
#include "event_handler.h"
|
||||
#include "ffrt.h"
|
||||
#include "i_input_event_consumer.h"
|
||||
#include "input_manager.h"
|
||||
#include "key_event.h"
|
||||
@ -70,8 +71,8 @@ public:
|
||||
|
||||
static sptr<AccessibilityInputInterceptor> GetInstance();
|
||||
~AccessibilityInputInterceptor();
|
||||
void ProcessKeyEvent(std::shared_ptr<MMI::KeyEvent> event) const;
|
||||
void ProcessPointerEvent(std::shared_ptr<MMI::PointerEvent> event) const;
|
||||
void ProcessKeyEvent(std::shared_ptr<MMI::KeyEvent> event);
|
||||
void ProcessPointerEvent(std::shared_ptr<MMI::PointerEvent> event);
|
||||
bool OnKeyEvent(MMI::KeyEvent &event) override;
|
||||
bool OnPointerEvent(MMI::PointerEvent &event) override;
|
||||
void OnMoveMouse(int32_t offsetX, int32_t offsetY) override;
|
||||
@ -97,6 +98,7 @@ private:
|
||||
MMI::InputManager *inputManager_ = nullptr;
|
||||
std::shared_ptr<AccessibilityInputEventConsumer> inputEventConsumer_ = nullptr;
|
||||
std::shared_ptr<AppExecFwk::EventHandler> eventHandler_ = nullptr;
|
||||
ffrt::mutex mutex_;
|
||||
};
|
||||
} // namespace Accessibility
|
||||
} // namespace OHOS
|
||||
|
@ -267,6 +267,7 @@ void AccessibilityInputInterceptor::DestroyInterceptor()
|
||||
|
||||
void AccessibilityInputInterceptor::DestroyTransmitters()
|
||||
{
|
||||
std::lock_guard<ffrt::mutex> lock(mutex_);
|
||||
HILOG_DEBUG();
|
||||
|
||||
if ((availableFunctions_ & FEATURE_MOUSE_KEY) != FEATURE_MOUSE_KEY) {
|
||||
@ -288,8 +289,9 @@ void AccessibilityInputInterceptor::DestroyTransmitters()
|
||||
}
|
||||
}
|
||||
|
||||
void AccessibilityInputInterceptor::ProcessPointerEvent(std::shared_ptr<MMI::PointerEvent> event) const
|
||||
void AccessibilityInputInterceptor::ProcessPointerEvent(std::shared_ptr<MMI::PointerEvent> event)
|
||||
{
|
||||
std::lock_guard<ffrt::mutex> lock(mutex_);
|
||||
HILOG_DEBUG();
|
||||
|
||||
if (mouseKey_) {
|
||||
@ -305,8 +307,9 @@ void AccessibilityInputInterceptor::ProcessPointerEvent(std::shared_ptr<MMI::Poi
|
||||
pointerEventTransmitters_->OnPointerEvent(*event);
|
||||
}
|
||||
|
||||
void AccessibilityInputInterceptor::ProcessKeyEvent(std::shared_ptr<MMI::KeyEvent> event) const
|
||||
void AccessibilityInputInterceptor::ProcessKeyEvent(std::shared_ptr<MMI::KeyEvent> event)
|
||||
{
|
||||
std::lock_guard<ffrt::mutex> lock(mutex_);
|
||||
HILOG_DEBUG();
|
||||
|
||||
if (mouseKey_) {
|
||||
|
@ -80,12 +80,12 @@ void AccessibilityInputInterceptor::DestroyInterceptor()
|
||||
void AccessibilityInputInterceptor::DestroyTransmitters()
|
||||
{}
|
||||
|
||||
void AccessibilityInputInterceptor::ProcessPointerEvent(std::shared_ptr<MMI::PointerEvent> event) const
|
||||
void AccessibilityInputInterceptor::ProcessPointerEvent(std::shared_ptr<MMI::PointerEvent> event)
|
||||
{
|
||||
(void)event;
|
||||
}
|
||||
|
||||
void AccessibilityInputInterceptor::ProcessKeyEvent(std::shared_ptr<MMI::KeyEvent> event) const
|
||||
void AccessibilityInputInterceptor::ProcessKeyEvent(std::shared_ptr<MMI::KeyEvent> event)
|
||||
{
|
||||
(void)event;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user