diff options
author | Kahrl <kahrl@gmx.net> | 2011-09-12 23:26:57 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2012-03-10 18:10:59 +0200 |
commit | 1bbfd0b6d26e5fd683e5e103feb35802e4ac595f (patch) | |
tree | e2ad9cb720f251982df5b4f75a1fff24abd90360 /src/keycode.h | |
parent | 4547ace59aa42defb3ca0212d1ebb2e3c17e14af (diff) | |
download | minetest-1bbfd0b6d26e5fd683e5e103feb35802e4ac595f.tar.gz minetest-1bbfd0b6d26e5fd683e5e103feb35802e4ac595f.tar.bz2 minetest-1bbfd0b6d26e5fd683e5e103feb35802e4ac595f.zip |
Different implementation of KeyPress::operator==
Fixes some key mapping issues.
Diffstat (limited to 'src/keycode.h')
-rw-r--r-- | src/keycode.h | 3 |
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; |