To @Michael Liu,
In my trial, I found that
shift
key is NOT detected when I pressed shift
key with following code.import { Component } from '@angular/core';
@Component({
selector: 'app-root',
template: `
<input type="text" (keyup)="updateField($event)" />
`,
})
export class AppComponent {
title = 'app-project';
updateField(event: KeyboardEvent): void {
// if (event.altKey && event.key === 'ShiftLeft') {
if (event.shiftKey) {
console.group('updateField in AppComponent class when the user pressed alt and left shift key at same time in the text field.');
console.log('The user pressed alt and left shift key at same time in the text field.');
console.groupEnd();
}
}
}
continue previous answer.
In my trial, I found that
shift
key is NOT detected when I pressed shift
key with following code.import { Component } from '@angular/core';
@Component({
selector: 'app-root',
template: `
<input type="text" (keyup.shift)="updateField($event)" />
`,
})
export class AppComponent {
title = 'app-project';
updateField(event: Event): void {
console.group('updateField in AppComponent class when the user pressed alt and left shift key at same time in the text field.');
console.log('The user pressed alt and left shift key at same time in the text field.');
console.groupEnd();
}
}