Is Mouse.KeyDown:Connect(function)(Key) limited to mouse presses only?

Seeing as it’s an event of the mouse, one would naturally assume that the key argument returns either one of the two mouse buttons but I see that people would check whether the keys pressed are letters. If it detects any general keys that are pressed, then why is it an event of the mouse? So is it any input that the script receives regardless of mouse buttons or keyboard letters?

Well, almost every keyboard has different functions/buttons. try and map out keys like, mouse button could be E or double click.

so, for your question. Yes, it can be if you do not describe it.

1 Like

Because making game engines is hard and sometimes mistakes are made, at least that’s my guess :sweat_smile:

If you check out the wiki page for KeyDown, you’ll see this:

1 Like

It’s for keyboard input. Back in the day, we didn’t have UserInputService. We only had Mouse. It was weird. Weird times. So, for some reason, the keyboard events were attached to the Mouse object. It was basically the centralized input API. It’s deprecated now.

2 Likes

It’s not really deprecated, it’s just superseded; But yeah, that pretty much means it was deprecated by another thing.

It’s marked as deprecated on the documentation

2 Likes

That’s new then…? I never saw it as deprecated, only we superseded :thinking:, at least on the Wikia it says superseded;

I think it’s deprecated because it was superseded :slight_smile:

2 Likes

Ah didn’t know there was a difference between deprecated and superseded.

Ahh okay, that explains it all. Whole thing had me confused for a moment there lol.

Okay, but does it still work correctly?

1 Like