projects
/
zefram
/
minetest
/
minetest_engine.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4547ace
)
Different implementation of KeyPress::operator==
author
Kahrl
<kahrl@gmx.net>
Mon, 12 Sep 2011 21:26:57 +0000
(23:26 +0200)
committer
Perttu Ahola
<celeron55@gmail.com>
Sat, 10 Mar 2012 16:10:59 +0000
(18:10 +0200)
Fixes some key mapping issues.
src/keycode.h
patch
|
blob
|
history
diff --git
a/src/keycode.h
b/src/keycode.h
index 28fb3f1fb86ccaf7ba7e3e85c0dd077b82407a65..51d9adf72ecd65eec95882af5a791826fabc618f 100644
(file)
--- 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;