Skip to content

Instantly share code, notes, and snippets.

@kahrl
Created August 7, 2015 03:58
Show Gist options
  • Save kahrl/405c00ec63dd7e293ab1 to your computer and use it in GitHub Desktop.
Save kahrl/405c00ec63dd7e293ab1 to your computer and use it in GitHub Desktop.
diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp
index 4674b2b..40afc7d 100644
--- a/src/defaultsettings.cpp
+++ b/src/defaultsettings.cpp
@@ -58,7 +58,7 @@ void set_default_settings(Settings *settings)
#if DEBUG
"KEY_F4");
#else
- "none");
+ "");
#endif
settings->setDefault("keymap_toggle_debug", "KEY_F5");
settings->setDefault("keymap_toggle_profiler", "KEY_F6");
diff --git a/src/keycode.cpp b/src/keycode.cpp
index 1ec3259..990dee3 100644
--- a/src/keycode.cpp
+++ b/src/keycode.cpp
@@ -256,7 +256,11 @@ KeyPress::KeyPress() :
KeyPress::KeyPress(const char *name)
{
- if (strlen(name) > 4) {
+ if (name[0] == 0) {
+ Key = irr::KEY_KEY_CODES_COUNT;
+ Char = L'\0';
+ return;
+ } else if (strlen(name) > 4) {
try {
Key = keyname_to_keycode(name);
m_name = name;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment