DasKeyboard: Update detection of US keyboard, and minor change to keyboard layout.

This commit is contained in:
mike 2024-10-26 19:11:21 +00:00 committed by Adam Honse
parent 19a69f4139
commit fc3116e596
2 changed files with 7 additions and 7 deletions

View file

@ -66,17 +66,17 @@ std::string DasKeyboardController::GetVersionString()
std::string DasKeyboardController::GetLayoutString()
{
/*-----------------------------------------------------*\
| Experimental for now; should be '16' for US and '28' |
| for EU layout |
\*-----------------------------------------------------*/
/*-----------------------------------------------------------*\
| Experimental for now; should be '16 or 63' for US and '28' |
| for EU layout |
\*-----------------------------------------------------------*/
if(version.length() < 17)
{
return("NONE");
}
std::string layout_id = version.substr(3, 2);
if(layout_id == "16")
if(layout_id == "16" || layout_id == "63")
{
return("US");
}

View file

@ -17,10 +17,10 @@ using namespace std::chrono_literals;
//0xFFFFFFFF indicates an unused entry in matrix
#define NA 0xFFFFFFFF
// US Layout TODO: mus be checked/corrected
// US Layout
static unsigned int matrix_map_us[7][21] =
{
{NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 126, NA, NA, NA},
{NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA},
{ 5, NA, 17, 23, 29, 35, 41, 47, 53, 59, 65, 71, 77, 83, 89, 95, 101, 127, 128, 129, 130},
{ 4, 10, 16, 22, 28, 34, 40, 46, 52, 58, 64, 70, 76, 82, 88, 94, 100, 106, 112, 118, 124},
{ 3, 9, 15, 21, 27, 33, 39, 45, 51, 57, 63, 69, 75, 7, 87, 93, 99, 105, 111, 117, 123},