Skip to content

Commit 9396cc2

Browse files
authored
Merge pull request #271 from Zegeri/keys
More user-friendly report of missing keys
2 parents b4f778f + 154c836 commit 9396cc2

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

src/xrEngine/xr_input.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,7 @@ bool CInput::get_dik_name(int dik, LPSTR dest_str, int dest_sz)
207207
if (dik == SDL_SCANCODE_UNKNOWN)
208208
keyname = "Unknown";
209209
else
210-
{
211-
Msg("! Can't convert dik_name for dik[%d]", dik);
212210
return false;
213-
}
214211
}
215212

216213
xr_strcpy(dest_str, dest_sz, keyname.c_str());

src/xrGame/xr_level_controller.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,22 @@ void initialize_bindings()
3737

3838
void remap_keys()
3939
{
40-
int idx = 0;
4140
string128 buff;
4241
// Log("Keys remap:");
43-
while (keyboards[idx].key_name)
42+
for (int idx = 0; keyboards[idx].key_name; ++idx)
4443
{
4544
buff[0] = 0;
4645
_keyboard& kb = keyboards[idx];
47-
const bool res = pInput->get_dik_name(kb.dik, buff, sizeof(buff));
48-
if (res)
46+
if (pInput->get_dik_name(kb.dik, buff, sizeof(buff)))
4947
kb.key_local_name = buff;
50-
else if (kb.key_local_name.empty())
51-
kb.key_local_name = kb.key_name;
48+
else
49+
{
50+
Msg("! Can't find a key name for %s", kb.key_name);
51+
if (kb.key_local_name.empty())
52+
kb.key_local_name = kb.key_name;
53+
}
5254

5355
// Msg("[%s]-[%s]", kb.key_name, kb.key_local_name.c_str());
54-
++idx;
5556
}
5657
}
5758

0 commit comments

Comments
 (0)