Different implementation of KeyPress::operator==
authorKahrl <kahrl@gmx.net>
Mon, 12 Sep 2011 21:26:57 +0000 (23:26 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Sat, 10 Mar 2012 16:10:59 +0000 (18:10 +0200)
Fixes some key mapping issues.

src/keycode.h

index 28fb3f1fb86ccaf7ba7e3e85c0dd077b82407a65..51d9adf72ecd65eec95882af5a791826fabc618f 100644 (file)
@@ -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;