From: Kahrl Date: Mon, 12 Sep 2011 21:26:57 +0000 (+0200) Subject: Different implementation of KeyPress::operator== X-Git-Tag: 0.4.dev-20120318~71 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=1bbfd0b6d26e5fd683e5e103feb35802e4ac595f;p=oweals%2Fminetest.git Different implementation of KeyPress::operator== Fixes some key mapping issues. --- 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;