summaryrefslogtreecommitdiff
path: root/src/guiInventoryMenu.cpp
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2011-08-13 22:44:31 +0200
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2011-08-22 13:01:11 +0200
commit7e610aece52ad547d4ae263aff5297342d5a4bff (patch)
tree983681e730d3d0ad782d38a1abec2f99cfae8b1a /src/guiInventoryMenu.cpp
parent16aedc0ef6cfd23f06b162501f26fd7f5c63172c (diff)
downloadminetest-7e610aece52ad547d4ae263aff5297342d5a4bff.tar.gz
minetest-7e610aece52ad547d4ae263aff5297342d5a4bff.tar.bz2
minetest-7e610aece52ad547d4ae263aff5297342d5a4bff.zip
Overhaul the input system
This allows us to map the keys which are not considered in irrlicht's EKEY_CODE system, such as \, [, /, ] etc.
Diffstat (limited to 'src/guiInventoryMenu.cpp')
-rw-r--r--src/guiInventoryMenu.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/guiInventoryMenu.cpp b/src/guiInventoryMenu.cpp
index 786a4dd22..f90a2e959 100644
--- a/src/guiInventoryMenu.cpp
+++ b/src/guiInventoryMenu.cpp
@@ -290,12 +290,9 @@ bool GUIInventoryMenu::OnEvent(const SEvent& event)
{
if(event.EventType==EET_KEY_INPUT_EVENT)
{
- if(event.KeyInput.Key==KEY_ESCAPE && event.KeyInput.PressedDown)
- {
- quitMenu();
- return true;
- }
- if(event.KeyInput.Key==getKeySetting("keymap_inventory") && event.KeyInput.PressedDown)
+ KeyPress kp(event.KeyInput);
+ if (event.KeyInput.PressedDown && (kp == EscapeKey ||
+ kp == getKeySetting("keymap_inventory")))
{
quitMenu();
return true;