Keyboard

open class Keyboard

Loads an XML description of a keyboard and stores the attributes of the keys. A keyboard consists of rows of keys.

The layout file for a keyboard contains XML that looks like the following snippet:

<Keyboard
        android:keyWidth="%10p"
        android:keyHeight="50px"
        android:horizontalGap="2px"
        android:verticalGap="2px" >
    <Row android:keyWidth="32px" >
        <Key android:keyLabel="A" />
        ...
    </Row>
    ...
</Keyboard>

Constructors

Link copied to clipboard
constructor(context: Context, xmlLayoutResId: Int)
Creates a keyboard from the given xml key layout file.
constructor(context: Context, @XmlRes xmlLayoutResId: Int, modeId: Int, width: Int, height: Int)
Creates a keyboard from the given xml key layout file.
constructor(context: Context, @XmlRes xmlLayoutResId: Int, modeId: Int)
Creates a keyboard from the given xml key layout file.
constructor(context: Context, layoutTemplateResId: Int, characters: CharSequence, columns: Int, horizontalPadding: Int)
Creates a blank keyboard from the given resource file and populates it with the specified characters in left-to-right, top-to-bottom fashion, using the specified number of columns.

Types

Link copied to clipboard
open class Key
Class for describing the position and characteristics of a single key in the keyboard.
Link copied to clipboard
open class Row
Container for keys in the keyboard.

Properties

Link copied to clipboard
val EDGE_BOTTOM: Int = 8
Link copied to clipboard
val EDGE_LEFT: Int = 1
Link copied to clipboard
val EDGE_RIGHT: Int = 2
Link copied to clipboard
val EDGE_TOP: Int = 4
Link copied to clipboard
val KEYCODE_ALT: Int = -6
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val KEYCODE_DONE: Int = -4
Link copied to clipboard
Link copied to clipboard
val KEYCODE_SHIFT: Int = -1

Functions

Link copied to clipboard
open fun getHeight(): Int
Returns the total height of the keyboard
Link copied to clipboard
Link copied to clipboard
open fun getMinWidth(): Int
Link copied to clipboard
Link copied to clipboard
open fun getNearestKeys(x: Int, y: Int): Array<Int>
Returns the indices of the keys that are closest to the given point.
Link copied to clipboard
open fun getShiftKeyIndex(): Int
Link copied to clipboard
Link copied to clipboard
open fun isShifted(): Boolean
Link copied to clipboard
open fun setShifted(shiftState: Boolean): Boolean