Show infotext with description for item entities
[oweals/minetest.git] / src / keycode.cpp
index d9fc88934cfc4da3a7c2505f206827f132eb2762..990dee339df12113ec3e5d059e7869c7d1984ffb 100644 (file)
@@ -18,7 +18,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 */
 
 #include "keycode.h"
-#include "main.h" // For g_settings
 #include "exceptions.h"
 #include "settings.h"
 #include "log.h"
@@ -257,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;