PageRenderTime 14ms CodeModel.GetById 6ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/CircleIME/src/com/marvin/circleime/LatinKeyboardViewOld.java

http://eyes-free.googlecode.com/
Java | 46 lines | 24 code | 7 blank | 15 comment | 3 complexity | 23b3905ed8a93e64b93b824848f53c96 MD5 | raw file
 1/*
 2 * Copyright (C) 2008-2009 Google Inc.
 3 * 
 4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 5 * use this file except in compliance with the License. You may obtain a copy of
 6 * the License at
 7 * 
 8 * http://www.apache.org/licenses/LICENSE-2.0
 9 * 
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 * License for the specific language governing permissions and limitations under
14 * the License.
15 */
16
17package com.marvin.circleime;
18
19import android.content.Context;
20import android.inputmethodservice.Keyboard;
21import android.inputmethodservice.KeyboardView;
22import android.inputmethodservice.Keyboard.Key;
23import android.util.AttributeSet;
24
25public class LatinKeyboardViewOld extends KeyboardView {
26
27    static final int KEYCODE_OPTIONS = -100;
28
29    public LatinKeyboardViewOld(Context context, AttributeSet attrs) {
30        super(context, attrs);
31    }
32
33    public LatinKeyboardViewOld(Context context, AttributeSet attrs, int defStyle) {
34        super(context, attrs, defStyle);
35    }
36
37    @Override
38    protected boolean onLongPress(Key key) {
39        if (key.codes[0] == Keyboard.KEYCODE_CANCEL) {
40            getOnKeyboardActionListener().onKey(KEYCODE_OPTIONS, null);
41            return true;
42        } else {
43            return super.onLongPress(key);
44        }
45    }
46}