# wrIsPrintableKey

> True for a single printable character typed without Ctrl, Cmd or Alt (Shift is allowed).

Source: https://ngwr.dev/reference/utils/wr-is-printable-key  
Kind: Util  
Updated in v16  
Optional

## Usage

Do not guard with `wrHasModifier` first: it counts Shift, so capitals would never arrive.

```angular-ts
import { wrIsPrintableKey } from 'ngwr/utils';

// Type-to-search: ignore arrows, Enter and chords.
@HostListener('keydown', ['$event']) onKey(e: KeyboardEvent) {
  if (wrIsPrintableKey(e)) buffer.push(e.key);
}
```

## API

| Name | Description | Type | Default |
| --- | --- | --- | --- |
| `wrIsPrintableKey(event)` | True for a single printable character with no Ctrl, Cmd or Alt held. Shift is accepted, so capitals arrive. | `(e: KeyboardEvent) => boolean` | `—` |

## See also

- [Keyboard](https://ngwr.dev/guides/keyboard) — Bind shortcuts, show them as keycaps, and see which keys each component handles.
- [wrHasModifier](https://ngwr.dev/reference/utils/wr-has-modifier) — True when Ctrl, Cmd, Alt, Shift or Meta is held during a KeyboardEvent.
- [WR_KEYS](https://ngwr.dev/reference/utils/wr-keys) — KeyboardEvent.key constants, the WrKey union of their values, and WR_KEY_LABELS, what each key is called on a keycap.
- [wrIsComposing](https://ngwr.dev/reference/utils/wr-is-composing) — True while an input method (IME) is composing, so the key belongs to it and not to your handler.
