JavaScript Keyboard Events

preview_player
Показать описание
How to capture and use Keyboard Events with JavaScript.
How to determine where the keyboard event is coming from and which key is being used.

Not covered in the video is the use of the event properties for determining whether or not the ALT, SHIFT, or CTRL keys were pressed at the same time as the other keys.

These are the event properties you would use to do that. You can find reference to them through the Keydown reference link below.

Рекомендации по теме
Комментарии
Автор

As a beginner, let log = console.log; is a game changer! I don't normally comment, but your videos are amazing Steve. Very clear and concise and they get me back on track when I leave class thinking "I have no idea that was about"

Chookz
Автор

I am so happy I stumbled upon your channel. It's a pot of gold. Thanks for the efforts you put in

SimPwear
Автор

Thanks for being generous sharing your code.

mdbdrrhm
Автор

Thank you for another amazing tutorial, precise and to the point. Love it.

rotrose
Автор

Great channel with great advanced tutorials that are not exists anywhere else

tahasoft
Автор

You might want to raise the volume a little bit man. However, a great tutorial after all

farsikogama
Автор

gracias estaba viendo en la documentacion, pero no me funcionaba el KeyCode, charCode, ni char, el unico que se me muestra en la consola es el which

daniel
Автор

Thanks for this ! I just noticed that when you type 'a' in the input, the charCode returns 65 wich is 'A' (capital a). D'u know the reason why ?

angladephil
Автор

Your tutorials are excellent. I'd just like you to use a better mic, or if you could speak louder.

mirzacerim
Автор

@3:40 How are you able to type outside the input and have no logged statements?
Wouldn't the event listener on the input tag bubble to the body tag as well?

questreal
Автор

Thank you very much for another great tutorial :D. I have learnt a lot from your Javascript From The Start playlist.

I have two questions:

1. What's the difference between target and currentTarget? I read on javascript.info and it said currentTarget is the element that has the event handler, while target doesnt necessarily has it but because of bubbling it still can trigger the event.
Does that mean in this case both INPUT and BODY are the currentTarget?

2. Why does the bubbling go from INPUT to BODY and "ignored" <p>?

maitran
Автор

you taught very well, but your keys and mouse made a lot of sounds than that of your... please check in future vids

swoorp
Автор

i could not run your code, keyboard events were not firing (no response when i typed on keyboard), iI am using Ubuntu Linux .

gwendolinebinya
Автор

Do you know how to detect when a key is hold for x seconds?

jackdo
Автор

How can I make it identify lowercase and uppercase?

froneotm
Автор

before you subscribed more than 100 js channals . but u fuckingg are so cool love the way show concepts ... lots of love from india ... love to have your mail address

girrajgupta