Skip to content

Function: keyAction() ​

ts
function keyAction(
   layout, 
   from, 
   key, 
   accept, 
   canActivate
): 
  | {
  move: Cell;
}
  | {
  activate: true;
}
  | {
  prevent: true;
}
  | undefined;

What a key does on a focused tile: move focus to another tile, activate it, or just stop the page scrolling (arrows at the edge). Undefined for keys that aren't ours.

Parameters ​

ParameterType
layoutLayout
fromCell
keystring
accept(cell) => boolean
canActivateboolean

Returns ​

| { move: Cell; } | { activate: true; } | { prevent: true; } | undefined

Hat tiling and isohedral tilings after Craig S. Kaplan's hatviz and Tactile (BSD 3-Clause).