1 /* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
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
;
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 final String LOGTAG
= LOKitInputConnectionHandler
.class.getSimpleName();
25 public InputConnection
onCreateInputConnection(EditorInfo outAttrs
) {
30 * When key pre-Ime happens.
33 public boolean onKeyPreIme(int keyCode
, KeyEvent event
) {
38 * When key down event happens.
41 public boolean onKeyDown(int keyCode
, KeyEvent event
) {
42 LOKitShell
.sendKeyEvent(event
);
47 * When key long press event happens.
50 public boolean onKeyLongPress(int keyCode
, KeyEvent event
) {
55 * When key multiple event happens. Key multiple event is triggered when
56 * non-ascii characters are entered on soft keyboard.
59 public boolean onKeyMultiple(int keyCode
, int repeatCount
, KeyEvent event
) {
60 LOKitShell
.sendKeyEvent(event
);
65 * When key up event happens.
68 public boolean onKeyUp(int keyCode
, KeyEvent event
) {
69 LOKitShell
.sendKeyEvent(event
);
74 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */