Reference · Rules, tiles and records
arrowStepfunction
The step in the grid an arrow key means: the square that way on the screen, with the table turned. Null for any other key.
Import it
import { arrowStep } from "@johnmorrisdotca/kumimoji";
Definition
function arrowStep(key: string, turn: Turn): { row: number; col: number; } | null
Parameters
| Name | Type | Description |
|---|---|---|
key | string | The keyboard key identifier. |
turn | Turn | The number of quarter turns of the view. |
Returns
{ row: number; col: number; } | null
The step in the grid an arrow key means: the square that way on the screen, with the table turned. null for any other key.
Examples
import { arrowStep } from "@johnmorrisdotca/kumimoji";
console.log(arrowStep("ArrowRight",1));{ row: -1, col: 0 }What it prints (run when this page was built)