aboutsummaryrefslogtreecommitdiff
path: root/src/content/controllers/FollowKeyController.ts
blob: 45d202a9993480b7dfd257152ab8069b6876300d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { injectable } from "tsyringe";
import FollowSlaveUseCase from "../usecases/FollowSlaveUseCase";
import Key from "../../shared/settings/Key";

@injectable()
export default class FollowKeyController {
  constructor(private followSlaveUseCase: FollowSlaveUseCase) {}

  press(key: Key): boolean {
    if (!this.followSlaveUseCase.isFollowMode()) {
      return false;
    }

    this.followSlaveUseCase.sendKey(key);
    return true;
  }
}