aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKahrl <kahrl@gmx.net>2011-09-12 23:26:57 +0200
committerPerttu Ahola <celeron55@gmail.com>2012-03-10 18:10:59 +0200
commit1bbfd0b6d26e5fd683e5e103feb35802e4ac595f (patch)
treee2ad9cb720f251982df5b4f75a1fff24abd90360 /src
parent4547ace59aa42defb3ca0212d1ebb2e3c17e14af (diff)
downloadminetest-1bbfd0b6d26e5fd683e5e103feb35802e4ac595f.tar.gz
minetest-1bbfd0b6d26e5fd683e5e103feb35802e4ac595f.tar.bz2
minetest-1bbfd0b6d26e5fd683e5e103feb35802e4ac595f.zip
Different implementation of KeyPress::operator==
Fixes some key mapping issues.
Diffstat (limited to 'src')
-rw-r--r--src/keycode.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/keycode.h b/src/keycode.h
index 28fb3f1fb..51d9adf72 100644
--- a/src/keycode.h
+++ b/src/keycode.h
@@ -36,7 +36,8 @@ public:
bool operator==(const KeyPress &o) const
{
- return valid_kcode(Key) ? Key == o.Key : Char == o.Char;
+ return (Char > 0 && Char == o.Char) ||
+ (valid_kcode(Key) && Key == o.Key);
}
const char *sym() const;