You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 

27 lines
712 B

import { injectable } from 'tsyringe';
import MarkUseCase from '../usecases/MarkUseCase';
import MarkKeyyUseCase from '../usecases/MarkKeyUseCase';
import Key from '../../shared/settings/Key';
@injectable()
export default class MarkKeyController {
constructor(
private markUseCase: MarkUseCase,
private markKeyUseCase: MarkKeyyUseCase,
) {
}
press(key: Key): boolean {
if (this.markKeyUseCase.isSetMode()) {
this.markUseCase.set(key.key);
this.markKeyUseCase.disableSetMode();
return true;
}
if (this.markKeyUseCase.isJumpMode()) {
this.markUseCase.jump(key.key);
this.markKeyUseCase.disableJumpMode();
return true;
}
return false;
}
}