mirror of
https://github.com/openharmony/accessibility.git
synced 2026-08-24 22:11:28 -04:00
在包含按住的各手势下模拟长按未生效
Signed-off-by: chenrui_wza <chenrui129@h-partners.com>
This commit is contained in:
@@ -345,7 +345,7 @@ private:
|
||||
void SendTouchEventToAA(MMI::PointerEvent &event);
|
||||
void SendGestureEventToAA(GestureType gestureId, uint64_t displayId);
|
||||
void SendEventToMultimodal(MMI::PointerEvent event, ChangeAction action);
|
||||
void SendScreenWakeUpEvent(MMI::PointerEvent &event);
|
||||
void SendScreenWakeUpEvent();
|
||||
void SendDragDownEventToMultimodal(MMI::PointerEvent event);
|
||||
void SendUpForDragDownEvent();
|
||||
bool GetPointerItemWithFingerNum(uint32_t fingerNum, std::vector<MMI::PointerEvent::PointerItem> &curPoints,
|
||||
|
||||
@@ -388,7 +388,7 @@ void TouchExploration::HandleTwoFingersDownStateMove(MMI::PointerEvent &event)
|
||||
CancelPostEvent(TouchExplorationMsg::TWO_FINGER_LONG_PRESS_MSG);
|
||||
if (event.GetPointerIds().size() != static_cast<uint32_t>(PointerCount::POINTER_COUNT_2)) {
|
||||
Clear();
|
||||
SendScreenWakeUpEvent(event);
|
||||
SendScreenWakeUpEvent();
|
||||
SetCurrentState(TouchExplorationState::INVALID);
|
||||
return;
|
||||
}
|
||||
@@ -685,7 +685,7 @@ void TouchExploration::HandleMultiFingersTapStateMove(MMI::PointerEvent &event,
|
||||
SetCurrentState(TouchExplorationState::INVALID);
|
||||
}
|
||||
|
||||
SendScreenWakeUpEvent(event);
|
||||
SendScreenWakeUpEvent();
|
||||
}
|
||||
|
||||
void TouchExploration::HandleTwoFingersTapStateMove(MMI::PointerEvent &event)
|
||||
@@ -749,7 +749,7 @@ void TouchExploration::HandleMultiFingersContinueDownStateMove(MMI::PointerEvent
|
||||
SetCurrentState(TouchExplorationState::INVALID);
|
||||
}
|
||||
|
||||
SendScreenWakeUpEvent(event);
|
||||
SendScreenWakeUpEvent();
|
||||
}
|
||||
|
||||
void TouchExploration::HandleTwoFingersContinueDownStateMove(MMI::PointerEvent &event)
|
||||
@@ -880,7 +880,7 @@ void TouchExploration::HandleThreeFingersDownStateMove(MMI::PointerEvent &event)
|
||||
CancelPostEvent(TouchExplorationMsg::THREE_FINGER_LONG_PRESS_MSG);
|
||||
if (event.GetPointerIds().size() != static_cast<uint32_t>(PointerCount::POINTER_COUNT_3)) {
|
||||
Clear();
|
||||
SendScreenWakeUpEvent(event);
|
||||
SendScreenWakeUpEvent();
|
||||
SetCurrentState(TouchExplorationState::INVALID);
|
||||
return;
|
||||
}
|
||||
@@ -889,7 +889,7 @@ void TouchExploration::HandleThreeFingersDownStateMove(MMI::PointerEvent &event)
|
||||
SetCurrentState(TouchExplorationState::THREE_FINGERS_SWIPE);
|
||||
}
|
||||
|
||||
SendScreenWakeUpEvent(event);
|
||||
SendScreenWakeUpEvent();
|
||||
}
|
||||
|
||||
void TouchExploration::HandleThreeFingersSwipeStateDown(MMI::PointerEvent &event)
|
||||
@@ -1044,7 +1044,7 @@ void TouchExploration::HandleThreeFingersSwipeStateMove(MMI::PointerEvent &event
|
||||
{
|
||||
receivedPointerEvents_.push_back(event);
|
||||
SaveMultiFingerSwipeGesturePointerInfo(event);
|
||||
SendScreenWakeUpEvent(event);
|
||||
SendScreenWakeUpEvent();
|
||||
}
|
||||
|
||||
void TouchExploration::HandleThreeFingersTapStateDown(MMI::PointerEvent &event)
|
||||
@@ -1109,7 +1109,7 @@ void TouchExploration::HandleFourFingersDownStateMove(MMI::PointerEvent &event)
|
||||
CancelPostEvent(TouchExplorationMsg::FOUR_FINGER_LONG_PRESS_MSG);
|
||||
if (event.GetPointerIds().size() != static_cast<uint32_t>(PointerCount::POINTER_COUNT_4)) {
|
||||
Clear();
|
||||
SendScreenWakeUpEvent(event);
|
||||
SendScreenWakeUpEvent();
|
||||
SetCurrentState(TouchExplorationState::INVALID);
|
||||
return;
|
||||
}
|
||||
@@ -1118,7 +1118,7 @@ void TouchExploration::HandleFourFingersDownStateMove(MMI::PointerEvent &event)
|
||||
SetCurrentState(TouchExplorationState::FOUR_FINGERS_SWIPE);
|
||||
}
|
||||
|
||||
SendScreenWakeUpEvent(event);
|
||||
SendScreenWakeUpEvent();
|
||||
}
|
||||
|
||||
void TouchExploration::HandleFourFingersSwipeStateDown(MMI::PointerEvent &event)
|
||||
@@ -1136,7 +1136,7 @@ void TouchExploration::HandleFourFingersSwipeStateMove(MMI::PointerEvent &event)
|
||||
{
|
||||
receivedPointerEvents_.push_back(event);
|
||||
SaveMultiFingerSwipeGesturePointerInfo(event);
|
||||
SendScreenWakeUpEvent(event);
|
||||
SendScreenWakeUpEvent();
|
||||
}
|
||||
|
||||
void TouchExploration::HandleFourFingersTapStateDown(MMI::PointerEvent &event)
|
||||
|
||||
@@ -22,6 +22,9 @@
|
||||
#include "parcel/accessibility_event_info_parcel.h"
|
||||
#include "accessibility_input_interceptor.h"
|
||||
#include "extend_service_manager.h"
|
||||
#ifdef OHOS_BUILD_ENABLE_POWER_MANAGER
|
||||
#include "accessibility_extend_power_manager.h"
|
||||
#endif
|
||||
#ifdef OHOS_BUILD_ENABLE_DISPLAY_MANAGER
|
||||
#include "accessibility_display_manager.h"
|
||||
#endif
|
||||
@@ -317,18 +320,10 @@ void TouchExploration::SendEventToMultimodal(MMI::PointerEvent event, ChangeActi
|
||||
EventTransmission::OnPointerEvent(event);
|
||||
}
|
||||
|
||||
void TouchExploration::SendScreenWakeUpEvent(MMI::PointerEvent &event)
|
||||
void TouchExploration::SendScreenWakeUpEvent()
|
||||
{
|
||||
HILOG_DEBUG();
|
||||
// Send move event to wake up the screen and prevent the screen from turning off.
|
||||
MMI::PointerEvent::PointerItem pointerItem {};
|
||||
for (auto& pId : event.GetPointerIds()) {
|
||||
event.GetPointerItem(pId, pointerItem);
|
||||
pointerItem.SetPressed(false);
|
||||
event.RemovePointerItem(pId);
|
||||
event.AddPointerItem(pointerItem);
|
||||
}
|
||||
SendEventToMultimodal(event, ChangeAction::NO_CHANGE);
|
||||
Singleton<AccessibilityExtendPowerManager>::GetInstance().RefreshActivity();
|
||||
}
|
||||
|
||||
void TouchExploration::HoverEventRunner()
|
||||
@@ -397,7 +392,7 @@ void TouchExploration::HandleInvalidState(MMI::PointerEvent &event)
|
||||
event.GetPointerItem(event.GetPointerId(), pointerItem);
|
||||
|
||||
if (event.GetPointerAction() == MMI::PointerEvent::POINTER_ACTION_MOVE) {
|
||||
SendScreenWakeUpEvent(event);
|
||||
SendScreenWakeUpEvent();
|
||||
}
|
||||
|
||||
// the last finger is lifted
|
||||
@@ -483,7 +478,7 @@ void TouchExploration::HandleOneFingerDownStateMove(MMI::PointerEvent &event)
|
||||
handler_->SendEvent(static_cast<uint32_t>(TouchExplorationMsg::SWIPE_COMPLETE_TIMEOUT_MSG), 0,
|
||||
static_cast<int32_t>(TimeoutDuration::SWIPE_COMPLETE_TIMEOUT));
|
||||
SetCurrentState(TouchExplorationState::ONE_FINGER_SWIPE);
|
||||
SendScreenWakeUpEvent(event);
|
||||
SendScreenWakeUpEvent();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -639,7 +634,7 @@ void TouchExploration::HandleOneFingerSwipeStateUp(MMI::PointerEvent &event)
|
||||
void TouchExploration::HandleOneFingerSwipeStateMove(MMI::PointerEvent &event)
|
||||
{
|
||||
AddOneFingerSwipeEvent(event);
|
||||
SendScreenWakeUpEvent(event);
|
||||
SendScreenWakeUpEvent();
|
||||
}
|
||||
|
||||
bool TouchExploration::RecordFocusedLocation(MMI::PointerEvent &event)
|
||||
|
||||
Reference in New Issue
Block a user