Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / android / source / src / java / org / libreoffice / LOKitInputConnectionHandler.java
blob804e7263594fb55e9bb5356e5995727b0b0acb20
1 /* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9 package org.libreoffice;
11 import android.view.KeyEvent;
12 import android.view.inputmethod.EditorInfo;
13 import android.view.inputmethod.InputConnection;
15 import org.mozilla.gecko.gfx.InputConnectionHandler;
17 /**
18 * Implementation of InputConnectionHandler. When a key event happens it is
19 * directed to this class which is then directed further to LOKitThread.
21 public class LOKitInputConnectionHandler implements InputConnectionHandler {
22 private static String LOGTAG = LOKitInputConnectionHandler.class.getSimpleName();
24 @Override
25 public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
26 return null;
29 /**
30 * When key pre-Ime happens.
32 @Override
33 public boolean onKeyPreIme(int keyCode, KeyEvent event) {
34 LOKitShell.sendKeyEvent(event);
35 return false;
38 /**
39 * When key down event happens.
41 @Override
42 public boolean onKeyDown(int keyCode, KeyEvent event) {
43 LOKitShell.sendKeyEvent(event);
44 return false;
47 /**
48 * When key long press event happens.
50 @Override
51 public boolean onKeyLongPress(int keyCode, KeyEvent event) {
52 return false;
55 /**
56 * When key multiple event happens. Key multiple event is triggered when
57 * non-ascii characters are entered on soft keyboard.
59 @Override
60 public boolean onKeyMultiple(int keyCode, int repeatCount, KeyEvent event) {
61 LOKitShell.sendKeyEvent(event);
62 return false;
65 /**
66 * When key up event happens.
68 @Override
69 public boolean onKeyUp(int keyCode, KeyEvent event) {
70 LOKitShell.sendKeyEvent(event);
71 return false;
75 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */