diff options
author | Marcus Comstedt | 2002-02-03 13:52:46 +0000 |
---|---|---|
committer | Marcus Comstedt | 2002-02-03 13:52:46 +0000 |
commit | 8b9dc1accfba36c174e01f16f53c83084740101b (patch) | |
tree | 0237c00ea334847a226b3cc64aca214568deb0af /dc | |
parent | 99a5e6138ce06c2a94986a97786023be3f69c6d4 (diff) | |
download | scummvm-rg350-8b9dc1accfba36c174e01f16f53c83084740101b.tar.gz scummvm-rg350-8b9dc1accfba36c174e01f16f53c83084740101b.tar.bz2 scummvm-rg350-8b9dc1accfba36c174e01f16f53c83084740101b.zip |
Fixed mouseclick bug.
svn-id: r3559
Diffstat (limited to 'dc')
-rw-r--r-- | dc/input.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/dc/input.cpp b/dc/input.cpp index 1c78d19460..77cb121c18 100644 --- a/dc/input.cpp +++ b/dc/input.cpp @@ -29,6 +29,7 @@ void handleInput(struct mapledev *pad, int16 &mouse_x, int16 &mouse_y, { int lmb=0, rmb=0, newkey=0; static int lastkey = 0; + static byte lastlmb = 0, lastrmb = 0; for(int i=0; i<4; i++, pad++) if(pad->func & MAPLE_FUNC_CONTROLLER) { int buttons = pad->cond.controller.buttons; @@ -104,14 +105,20 @@ void handleInput(struct mapledev *pad, int16 &mouse_x, int16 &mouse_y, } } - if(lmb) + if(lmb && !lastlmb) { leftBtnPressed |= msClicked|msDown; - else + lastlmb = 1; + } else if(lastlmb && !lmb) { leftBtnPressed &= ~msDown; - if(rmb) + lastlmb = 0; + } + if(rmb && !lastrmb) { rightBtnPressed |= msClicked|msDown; - else + lastrmb = 1; + } else if(lastrmb && !rmb) { rightBtnPressed &= ~msDown; + lastrmb = 0; + } if(!newkey) lastkey = 0; |