SFML community forums

General => Pull Requests & Testing => Topic started by: eXpl0it3r on May 27, 2021, 02:01:24 pm

Title: Scancodes - Round 2
Post by: eXpl0it3r on May 27, 2021, 02:01:24 pm
Scancodes is the last (major) feature which is required by the Roadmap (https://en.sfml-dev.org/forums/index.php?topic=24372.0) planning to complete SFML 2.6

We have already done a Round 1 (https://en.sfml-dev.org/forums/index.php?topic=23889.0) of reviewing and testing with different branches and still some misalignments.
After quite some additional work and great documentation efforts, I believe the code base is close to finalization and we'd like to invite everyone to help review and test our Scancodes implementation.

Code & PR: https://github.com/SFML/SFML/pull/1235
Snapshot Builds: https://artifacts.sfml-dev.org/by-branch/feature/scancode/

Purpose

Scancodes are a very important feature that's been asked to be implemented in SFML for a long time. It gives developers a layout independent way of reading keyboard input. Suppose you're using standard "WASD" walking input scheme in your game. If you just say "if pressed sf::Keyboard::Key::A then go left", it'll work as expected only on a QWERTY and a bunch of layouts where "WASD" is in the place gamers usually expect it to be. But, it'll work wrong on AZERTY layout, which has "A" where "Q" on QWERTY is.

Scancodes prevent this problem. If we say "if pressed sf::Keyboard::ScanA then go left", we're telling something like "if pressed the key which is in the place where A on QWERTY keyboards is then go left".

Testing

Either of the follow applications can be used to test:

The Scancode names and documentation description are generally in reference to the AT-101 layout, as for example seen on the following image:
(https://deskthority.net/wiki/images/7/76/Dell_GYIAT101-102_front.JPG) (https://deskthority.net/wiki/images/7/76/Dell_GYIAT101-102_front.JPG)

Testing is especially important if you have non-QWERTY layout. The more non-traditional it is, the better. Another good thing to test for is weird keyboards with non-grid layouts.

Things to test

New API