diff --git a/src/keycode.cpp b/src/keycode.cpp
index 48d010cf4f4de98d345f8754acbb5ce0b43e13a5..2e211ad59179fabf4830713869305d8ffb1f8c27 100644
--- a/src/keycode.cpp
+++ b/src/keycode.cpp
@@ -385,3 +385,8 @@ void clearKeyCache()
 {
 	g_key_setting_cache.clear();
 }
+
+irr::EKEY_CODE keyname_to_keycode(const char *name)
+{
+	return lookup_keyname(name).Key;
+}