Reputation: 1186
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
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:
Upvotes: 6