# KeyboardDecoder

A utility for quickly searching for keyboard values.

package | Application

### Methods

## Constructor which remembers the keyboard tables for later search.

    __construct(intxValues, intyValues) : mixed

For efficency, the values are stored statically.

### Arguments

#### xValues

`int`

A two dimensional table of keyboard values. [0] contains the MSDs, [1] the LSDs.

#### yValues

`int`

A two dimensional table of keyboard values. [0] contains the MSDs, [1] the LSDs.

### Response

`mixed`

## This method turns a type into a human-readable string.

    getTypeName(inttype) : int[]

### Arguments

#### type

`int`

### Response

`int[]`

## Searches the tables for a value represented by the character. If it is an MSD it is scaled appropriately.

    getValue(stringch) : int

Throws | \com\scriptel\SignatureInvalidException

### Arguments

#### ch

`string`

### Response

`int`

The value of the character.

## This method takes four characters and attempts to decode them into an x and y coordinate component used with the uncompressed EasyScript protocol.

    getValues(string[]chrs) : int[]

Throws | \com\scriptel\IllegalArgumentException \com\scriptel\SignatureInvalidException

### Arguments

#### chrs

`string[]`

Character array to decode.

### Response

`int[]`

An array with two elements, the first element being the x-axis component, the second being the y-axis component.

### Constants

## Indicates this type is on the X-axis

    X

## Indicates this type is on the Y-axis

    Y

## Indicates this type is a most significant digit.

    MSD

## Indicates this type is a least significant digit.

    LSD

### Properties

## Map of keyboard protocol values indexed on character values.

    values : \com\scriptel\KeyboardValue

var |

### Type(s)

`KeyboardValue`