diff options
author | Simon Howard | 2013-11-17 02:15:19 +0000 |
---|---|---|
committer | Simon Howard | 2013-11-17 02:15:19 +0000 |
commit | 33703db6c4ca9c23c3d5cbc4b8602bd9679f234a (patch) | |
tree | e4d02fcab0d1a1de2a86bff457a3639f26b55d00 /src/i_video.c | |
parent | 51526b9a4a3e1b576f3fc34d3093cc97dfe73a28 (diff) | |
download | chocolate-doom-33703db6c4ca9c23c3d5cbc4b8602bd9679f234a.tar.gz chocolate-doom-33703db6c4ca9c23c3d5cbc4b8602bd9679f234a.tar.bz2 chocolate-doom-33703db6c4ca9c23c3d5cbc4b8602bd9679f234a.zip |
Initialize data2 to zero for ev_keyup events, rather than just letting
them have junk values.
Subversion-branch: /branches/v2-branch
Subversion-revision: 2749
Diffstat (limited to 'src/i_video.c')
-rw-r--r-- | src/i_video.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/i_video.c b/src/i_video.c index 606fb5ac..1f375577 100644 --- a/src/i_video.c +++ b/src/i_video.c @@ -756,6 +756,14 @@ void I_GetEvent(void) event.type = ev_keyup; event.data1 = TranslateKey(&sdlevent.key.keysym); + // data2 is just initialized to zero for ev_keyup. + // For ev_keydown it's the shifted Unicode character + // that was typed, but if something wants to detect + // key releases it should do so based on data1 + // (key ID), not the printable char. + + event.data2 = 0; + if (event.data1 != 0) { D_PostEvent(&event); |