diff options
author | Marcus Comstedt | 2002-12-06 01:30:38 +0000 |
---|---|---|
committer | Marcus Comstedt | 2002-12-06 01:30:38 +0000 |
commit | 05ff6451fc4b25de9bc01f572959b356ec9cf282 (patch) | |
tree | 16471aff561cb27ef442b6f8475083c9b7c0c853 | |
parent | 6e49b481fcf0b5abd7f6aa77053729ca700c5698 (diff) | |
download | scummvm-rg350-05ff6451fc4b25de9bc01f572959b356ec9cf282.tar.gz scummvm-rg350-05ff6451fc4b25de9bc01f572959b356ec9cf282.tar.bz2 scummvm-rg350-05ff6451fc4b25de9bc01f572959b356ec9cf282.zip |
Generate KEY_UP events as well...
svn-id: r5849
-rw-r--r-- | backends/dc/input.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/backends/dc/input.cpp b/backends/dc/input.cpp index 7807616caa..c12731fe01 100644 --- a/backends/dc/input.cpp +++ b/backends/dc/input.cpp @@ -126,9 +126,12 @@ int handleInput(struct mapledev *pad, int &mouse_x, int &mouse_y, return -OSystem::EVENT_RBUTTONUP; } - if(!newkey) + if(!newkey || (lastkey && newkey != lastkey)) { + int upkey = lastkey; lastkey = 0; - else if(newkey != lastkey) + if(upkey) + return upkey | (1<<30); + } else if(!lastkey) return lastkey = newkey; return 0; @@ -157,7 +160,8 @@ bool OSystem_Dreamcast::poll_event(Event *event) event->event_code = -e; return true; } else if(e>0) { - event->event_code = EVENT_KEYDOWN; + event->event_code = ((e&(1<<30))? EVENT_KEYUP : EVENT_KEYDOWN); + e &= ~(1<<30); event->kbd.keycode = e; event->kbd.ascii = (e>='a' && e<='z' && (event->kbd.flags & KBD_SHIFT)? e &~ 0x20 : e); |