import 'gesture_action.dart';

class GestureBindings {
  final double keyboardHoldLeftSpeed;
  final double keyboardHoldRightSpeed;
  final GestureAction mouseLeftClickAction;
  final GestureAction mouseLeftDoubleClickAction;
  final GestureAction mouseRightClickAction;
  final GestureAction mouseRightDoubleClickAction;

  const GestureBindings({
    required this.keyboardHoldLeftSpeed,
    required this.keyboardHoldRightSpeed,
    required this.mouseLeftClickAction,
    required this.mouseLeftDoubleClickAction,
    required this.mouseRightClickAction,
    required this.mouseRightDoubleClickAction,
  });

  static const defaults = GestureBindings(
    keyboardHoldLeftSpeed: 0.5,
    keyboardHoldRightSpeed: 3.0,
    mouseLeftClickAction: GestureAction.playPause,
    mouseLeftDoubleClickAction: GestureAction.fullscreen,
    mouseRightClickAction: GestureAction.toggleControls,
    mouseRightDoubleClickAction: GestureAction.none,
  );

  GestureAction actionFor(GestureKind kind) => switch (kind) {
    GestureKind.leftClick => mouseLeftClickAction,
    GestureKind.leftDoubleClick => mouseLeftDoubleClickAction,
    GestureKind.rightClick => mouseRightClickAction,
    GestureKind.rightDoubleClick => mouseRightDoubleClickAction,
  };
}
