# `ngKeypress` (directive in module `ng` )

Improve this doc

## Description

Specify custom behavior on keypress event.

## Usage

as attribute

    <ANY ng-keypress="{expression}">
       ...
    </ANY>

as class

    <ANY class="ng-keypress: {expression};">
       ...
    </ANY>

### Parameters

- `ngKeypress – {expression} –`

  Expression to evaluate upon keypress. (Event object is available as `$event` and can be interrogated for keyCode, altKey, etc.)

## Example

See `ngClick`