1 /* 2 * Copyright (c) 2025-2025 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #include "window_input_intercept_client.h" 17 #include "input_transfer_station.h" 18 #include "window_input_intercept.h" 19 20 namespace OHOS { 21 namespace Rosen { 22 RegisterInputEventIntercept(const int32_t deviceId,const std::shared_ptr<IInputEventInterceptConsumer> & consumer)23void WindowInputInterceptClient::RegisterInputEventIntercept(const int32_t deviceId, 24 const std::shared_ptr<IInputEventInterceptConsumer>& consumer) 25 { 26 WindowInputIntercept::GetInstance().RegisterInputEventIntercept(deviceId, consumer); 27 } 28 UnRegisterInputEventIntercept(const int32_t deviceId)29void WindowInputInterceptClient::UnRegisterInputEventIntercept(const int32_t deviceId) 30 { 31 WindowInputIntercept::GetInstance().UnRegisterInputEventIntercept(deviceId); 32 } 33 SendInputEvent(const std::shared_ptr<MMI::KeyEvent> & keyEvent)34void WindowInputInterceptClient::SendInputEvent(const std::shared_ptr<MMI::KeyEvent>& keyEvent) 35 { 36 InputTransferStation::GetInstance().HandleInputEvent(keyEvent); 37 } 38 SendInputEvent(const std::shared_ptr<MMI::PointerEvent> & pointerEvent)39void WindowInputInterceptClient::SendInputEvent(const std::shared_ptr<MMI::PointerEvent>& pointerEvent) 40 { 41 InputTransferStation::GetInstance().HandleInputEvent(pointerEvent); 42 } 43 } 44 }