{
  "$schema": "flyplay/keymap@1",
  "$meta": {
    "owner": "INPUT",
    "src": "design doc section 03 (controls); contracts/actions.js defaults; INPUT design of the gamepad layer and the touch slots (PLAN section 5 INPUT)",
    "unit": {
      "look.mouse": "rad per pixel (x sensitivity)",
      "look.key": "rad per step while an arrow key is held (x sensitivity)",
      "look.stick": "rad per step at full stick deflection (x sensitivity)",
      "look.touch": "rad per pixel of finger drag (x sensitivity)",
      "look.maxStep": "rad: the largest turn one step may report on one axis",
      "touch.stickRadiusPx": "px of finger travel for full deflection",
      "touch.twoFingerMs": "ms: both fingers of a two-finger tap must land within this",
      "touch.tapMaxMs": "ms: both fingers of a two-finger tap must lift within this"
    },
    "note": "kbm / pad lists are the DEFAULT bindings (settings input.bindings overrides them). move.kbm = [forward, back, left, right]; look.kbm = [MouseMove, left, right, up, down]. A pad entry 'Select+A' is a chord (A while Select is held); Select stays the map button when it is tapped and is the layer key when it is held. Mouse2 / L3 are lookOnly in the air with no fight (when: free) and block otherwise (when: engaged). touch: stick | drag | main (always on screen) | skills | more (behind the ... button) | pause | direct (menus are operated by touching their controls)."
  },
  "actions": {
    "move":       { "kbm": ["KeyW", "KeyS", "KeyA", "KeyD"], "pad": ["LStick"], "touch": "stick", "group": "move" },
    "look":       { "kbm": ["MouseMove", "ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown"], "pad": ["RStick"], "touch": "drag", "group": "move" },
    "takeoff":    { "kbm": ["Space"], "pad": ["A"], "touch": "main", "group": "move" },
    "descend":    { "kbm": ["KeyC"], "pad": ["B"], "touch": "main", "group": "move" },
    "sprint":     { "kbm": ["ShiftLeft"], "pad": ["RT"], "touch": "main", "group": "move" },
    "interact":   { "kbm": ["KeyE"], "pad": ["X"], "touch": "main", "group": "act" },
    "smell":      { "kbm": ["KeyQ"], "pad": ["LT"], "touch": "main", "group": "act" },
    "eye":        { "kbm": ["KeyV"], "pad": ["Select+RB"], "touch": "main", "group": "act" },
    "skill1":     { "kbm": ["Digit1"], "pad": ["DPadUp", "Y"], "touch": "skills", "group": "act" },
    "skill2":     { "kbm": ["Digit2"], "pad": ["DPadRight"], "touch": "skills", "group": "act" },
    "skill3":     { "kbm": ["Digit3"], "pad": ["DPadDown"], "touch": "skills", "group": "act" },
    "skill4":     { "kbm": ["Digit4"], "pad": ["DPadLeft"], "touch": "skills", "group": "act" },
    "wheel":      { "kbm": ["KeyR"], "pad": ["LB"], "touch": "more", "group": "act" },
    "groom":      { "kbm": ["KeyG"], "pad": ["Select+X"], "touch": "more", "group": "act" },
    "freeze":     { "kbm": ["KeyX"], "pad": ["Select+B"], "touch": "more", "group": "act" },
    "rest":       { "kbm": ["KeyZ"], "pad": ["Select+A"], "touch": "more", "group": "act" },
    "attack":     { "kbm": ["Mouse0"], "pad": ["R3"], "touch": "main", "group": "combat" },
    "block":      { "kbm": ["Mouse2"], "pad": ["L3"], "touch": "main", "group": "combat", "when": "engaged" },
    "lookOnly":   { "kbm": ["Mouse2"], "pad": ["L3"], "touch": "more", "group": "combat", "when": "free" },
    "threat":     { "kbm": ["KeyF"], "pad": ["Select+Y"], "touch": "more", "group": "combat" },
    "lock":       { "kbm": ["Mouse1"], "pad": ["RB"], "touch": "more", "group": "combat" },
    "map":        { "kbm": ["KeyM"], "pad": ["Select"], "touch": "more", "group": "panel" },
    "objectives": { "kbm": ["KeyJ"], "pad": ["Select+DPadUp"], "touch": "more", "group": "panel" },
    "brain":      { "kbm": ["KeyK"], "pad": ["Select+DPadRight"], "touch": "more", "group": "panel" },
    "lineage":    { "kbm": ["KeyL"], "pad": ["Select+DPadDown"], "touch": "more", "group": "panel" },
    "body":       { "kbm": ["KeyB"], "pad": ["Select+DPadLeft"], "touch": "more", "group": "panel" },
    "oracle":     { "kbm": ["KeyO"], "pad": ["Select+LB"], "touch": "more", "group": "panel" },
    "pause":      { "kbm": ["Escape"], "pad": ["Start"], "touch": "pause", "group": "panel" },
    "ui_up":      { "kbm": ["ArrowUp", "KeyW"], "pad": ["DPadUp"], "touch": "direct", "group": "menu" },
    "ui_down":    { "kbm": ["ArrowDown", "KeyS"], "pad": ["DPadDown"], "touch": "direct", "group": "menu" },
    "ui_left":    { "kbm": ["ArrowLeft", "KeyA"], "pad": ["DPadLeft"], "touch": "direct", "group": "menu" },
    "ui_right":   { "kbm": ["ArrowRight", "KeyD"], "pad": ["DPadRight"], "touch": "direct", "group": "menu" },
    "ui_confirm": { "kbm": ["Enter", "Space"], "pad": ["A"], "touch": "direct", "group": "menu" },
    "ui_cancel":  { "kbm": ["Escape", "Backspace"], "pad": ["B"], "touch": "direct", "group": "menu" },
    "ui_next":    { "kbm": ["Tab", "KeyE"], "pad": ["RB"], "touch": "direct", "group": "menu" },
    "ui_prev":    { "kbm": ["KeyQ"], "pad": ["LB"], "touch": "direct", "group": "menu" }
  },
  "pairs": [["pause", "ui_cancel"]],
  "tuning": {
    "look": { "mouse": 0.0022, "key": 0.03, "stick": 0.042, "touch": 0.0042, "stickCurve": 1.6, "maxStep": 1.0 },
    "pad": { "press": 0.55, "release": 0.35, "outer": 0.98 },
    "touch": { "stickRadiusPx": 52, "stickDead": 0.12, "tapSlopPx": 14, "twoFingerMs": 150, "tapMaxMs": 350 }
  }
}
