What?

Bind an event to a particular keypress

Why?

Cuz you feel like it? Maybe I should stop doing the 'Why' sections, running out of explanations...

How?

The directive takes a hash (object) with the key code as the key and the callback function to fire as the value. The callback function takes an 'event' param

Note that 13 represents the RETURN key code.

<textarea
        ui-keypress="{13:'keypressCallback($event)'}">
</textarea>
<textarea
        ui-keydown="{'enter alt-space':'keypressCallback($event)'}">
</textarea>
<textarea
        ui-keyup="{'enter':'keypressCallback($event)'}">
</textarea>

<script>
    $scope.keypressCallback = function($event) {
        alert('Voila!');
        $event.preventDefault();
    };
</script>