Skip to content

Commit

Permalink
More user-friendly report of missing keys
Browse files Browse the repository at this point in the history
Shows the scancode name instead of the scancode value.
  • Loading branch information
Zegeri committed Nov 8, 2018
1 parent 685e47d commit adc9937
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 0 additions & 3 deletions src/xrEngine/xr_input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,7 @@ bool CInput::get_dik_name(int dik, LPSTR dest_str, int dest_sz)
if (dik == SDL_SCANCODE_UNKNOWN)
keyname = "Unknown";
else
{
Msg("! Can't convert dik_name for dik[%d]", dik);
return false;
}
}

xr_strcpy(dest_str, dest_sz, keyname.c_str());
Expand Down
8 changes: 6 additions & 2 deletions src/xrGame/xr_level_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,12 @@ void remap_keys()
const bool res = pInput->get_dik_name(kb.dik, buff, sizeof(buff));
if (res)
kb.key_local_name = buff;
else if (kb.key_local_name.empty())
kb.key_local_name = kb.key_name;
else
{
Msg("! Can't find a key name for %s", kb.key_name);
if (kb.key_local_name.empty())
kb.key_local_name = kb.key_name;
}

// Msg("[%s]-[%s]", kb.key_name, kb.key_local_name.c_str());
++idx;
Expand Down

0 comments on commit adc9937

Please sign in to comment.