Code example for Keyboard

Methods: getHeightgetMinWidth

0
 
    @Override 
    public void setKeyboard(Keyboard k) {
        super.setKeyboard(k);
        // One-seventh of the keyboard width seems like a reasonable threshold 
        mJumpThresholdSquare = k.getMinWidth() / 7;
        mJumpThresholdSquare *= mJumpThresholdSquare;
        // Assuming there are 4 rows, this is the coordinate of the last row 
        mLastRowY = (k.getHeight() * 3) / 4;
        setKeyboardLocal(k);
    } 
 
    @Override 
    protected boolean onLongPress(Key key) {
        if (key.codes[0] == Keyboard.KEYCODE_MODE_CHANGE) {
            getOnKeyboardActionListener().onKey(KEYCODE_OPTIONS, null);
            return true; 
        } else if (key.codes[0] == Keyboard.KEYCODE_SHIFT) {
            getOnKeyboardActionListener().onKey(KEYCODE_SHIFT_LONGPRESS, null);
            invalidateAllKeys();