# mapKeyAction

Maps a key press on the map region to an action.

This is a function exported by `@mapcairn/core`, checked against version 0.2.0.

## Signature

```ts
import { mapKeyAction } from "@mapcairn/core";
 
function mapKeyAction(event: MapKeyEvent): MapKeyAction | null;
```

## Parameters

- `event` (`MapKeyEvent`)

## Returns

`MapKeyAction | null`: The action, or null when the key is not a map shortcut. Any
 ctrl, meta or alt modifier gives null so browser and system shortcuts
 keep working. Shift is otherwise ignored for the character keys, because
 "+" and "_" need it on many keyboards.

## Remarks

For `pan`, `dx` and `dy` are screen pixels with y pointing down,
 and the map view moves the way the arrow points: ArrowRight shows more
 of the map to the right. Shift with left or right rotates; Shift with up
 or down pans further.

## See also

- [`MapKeyEvent`](https://docs.mapcairn.com/api/core/MapKeyEvent.md)
- [`MapKeyAction`](https://docs.mapcairn.com/api/core/MapKeyAction-typealias.md)

Source: [packages/core/src/keyboard/keyboard.ts:58](https://github.com/MapCairn/mapcairn/blob/main/packages/core/src/keyboard/keyboard.ts#L58)
