如何测试此方法(角度):
public detectCapslock(event: KeyboardEvent): void {
let capsOn: boolean = event.getModifierState && event.getModifierState("CapsLock");
if (capsOn) {
this.capsOn = "Caps Lock on";
} else {
this.capsOn = "";
}
}