I'm working on a terminal-like modal, using bootstrap's and I want to clear it when the user presses Ctrl+L like it does when he writes clear
in it.
But the problem is, when I press Ctrl+L, it focuses the URL bar, and I don't have anymore focus on my page.
In this part, alert is showing, but it still focuses URL bar after :
if(event.key == "l" && event.ctrlKey)
alert("clear it");
I have tried several things like focusing my terminal after a sec, or things like that. But nothing worked.
Have you got any ideas ? Thanks you !