aboutsummaryrefslogtreecommitdiff
path: root/src/content/controllers/FollowKeyController.ts
blob: 59d227174ee8652cb11e039197c03eef3f39953c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { injectable } from 'tsyringe';
import FollowSlaveUseCase from '../usecases/FollowSlaveUseCase';
import Key from '../domains/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;
  }
}