From: Kahrl Date: Mon, 12 Sep 2011 21:26:57 +0000 (+0200) Subject: Different implementation of KeyPress::operator== X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=1bbfd0b6d26e5fd683e5e103feb35802e4ac595f;p=zefram%2Fminetest%2Fminetest_engine.git Different implementation of KeyPress::operator== Fixes some key mapping issues. --- diff --git a/src/keycode.h b/src/keycode.h index 28fb3f1f..51d9adf7 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;