2 * Copyright (C) 2010 The Android Open Source Project
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
20 * Handles input messages that arrive on an input channel.
23 public interface InputHandler {
26 * It is the responsibility of the callee to ensure that the finished callback is
27 * eventually invoked when the event processing is finished and the input system
28 * can send the next event.
29 * @param event The key event data.
30 * @param finishedCallback The callback to invoke when event processing is finished.
32 public void handleKey(KeyEvent event, Runnable finishedCallback);
35 * Handle a motion event.
36 * It is the responsibility of the callee to ensure that the finished callback is
37 * eventually invoked when the event processing is finished and the input system
38 * can send the next event.
39 * @param event The motion event data.
40 * @param finishedCallback The callback to invoke when event processing is finished.
42 public void handleMotion(MotionEvent event, Runnable finishedCallback);