Trouble in keydown event

I’m currently doing todays’ JavaScriptmas challenge and I’m having trouble with the counting, basically, the count triggers also when you press thing like ctrl, alt etc. I want it to only trigger on printable characters, there is this method called keypress which does satisfy me (i think) but it’s no longer reccomended and i’m not sure if it can work for emojis, so how can i make it work for only printable characters? i know there’s ASCII and charCodeAt() but the don’t seem to work, and i also don’t know if they work for emojis