I have a keydown event and I want it to be triggered when I press alphanumeric or special characters like #$@.
<input type="text" style="width: 70%;" [(ngModel)]= "textMessage" (keydown) ="sendTypingEvent()" > I want to restrict the event NOT to be triggered at all for keys such as enter, escape (esc), shift, alt, tab, backspace and command (meta), arrows and f keys (f1 though f12).
Is there a way to set up a REGEX pattern at the HTML?
<input (keydown.a)="..."> --expect to trigger I can have the event triggered and filter the key at the function call as shown below. However, trying to see if there are any other options.
sendTypingEvent(event) { if (event.key === "Enter" || event.key ==='esc' .... ) { console.log("skip this event"); } }