nevzatseferoglu
nevzatseferoglu

Reputation: 1186

Difference between SDL_Scancode and SDL_Keycode

I am in a learning process of SDL library by version 2.0. When I checked out SDL_Event handling , I got two different representations for keyboard event.

SDL_Scancode

SDL_Keycode

I could not understand the difference between them.Despite trying.

What are those differences ? and Why are those as amount two ?

Upvotes: 5

Views: 6370

Answers (1)

Bob
Bob

Reputation: 2616

According to the SDL wiki: "The scancode identifies the location of a key press and the corresponding SDL_Keycode gives that key press meaning in the context of the current keyboard layout. "

So as mentioned in the comments by @HolyBlackCat if you are using a QWERTY keyboard they will be the same, but if using an AZERTY keyboard Z should have Z keycode and W scancode

Links to relevant parts of SDL Wiki:

SDL_Scancode

SDL_Keycode

Upvotes: 6

Related Questions