diff options
author | Chris Apers | 2006-01-23 19:23:52 +0000 |
---|---|---|
committer | Chris Apers | 2006-01-23 19:23:52 +0000 |
commit | 01fdeba50a219021ec8076db3a780a89596ad7ea (patch) | |
tree | efa0a0ae323c3febd87a78b6bbbcab05181fb237 /backends/PalmOS/Src/os5_event.cpp | |
parent | 86ba8201603f2b08731356481787e61dd7d02139 (diff) | |
download | scummvm-rg350-01fdeba50a219021ec8076db3a780a89596ad7ea.tar.gz scummvm-rg350-01fdeba50a219021ec8076db3a780a89596ad7ea.tar.bz2 scummvm-rg350-01fdeba50a219021ec8076db3a780a89596ad7ea.zip |
New OS5 backend :
- 16bit support
- Added SetWindowCaption function
- New 'no thread' sound code
- Wide mode support
- OSD support
svn-id: r20145
Diffstat (limited to 'backends/PalmOS/Src/os5_event.cpp')
-rwxr-xr-x | backends/PalmOS/Src/os5_event.cpp | 69 |
1 files changed, 68 insertions, 1 deletions
diff --git a/backends/PalmOS/Src/os5_event.cpp b/backends/PalmOS/Src/os5_event.cpp index fe8540effa..4691092b15 100755 --- a/backends/PalmOS/Src/os5_event.cpp +++ b/backends/PalmOS/Src/os5_event.cpp @@ -1,7 +1,7 @@ /* ScummVM - Scumm Interpreter * Copyright (C) 2001 Ludvig Strigeus * Copyright (C) 2001-2006 The ScummVM project - * Copyright (C) 2002-2005 Chris Apers - PalmOS Backend + * Copyright (C) 2002-2006 Chris Apers - PalmOS Backend * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -29,4 +29,71 @@ void OSystem_PalmOS5::get_coordinates(EventPtr ev, Coord &x, Coord &y) { x = (ev->screenX - _screenOffset.x); y = (ev->screenY - _screenOffset.y); + + if (_stretched) { + if (OPTIONS_TST(kOptModeLandscape)) { + x = (x * 2 / 3); + y = (y * 2 / 3); + } else { + y = ((ev->screenX - _screenOffset.y) * 2) / 3; + x = 320 - ((ev->screenY - _screenOffset.x) * 2) / 3 - 1; + } + } +} + +bool OSystem_PalmOS5::check_event(Event &event, EventPtr ev) { + if (ev->eType == keyDownEvent) { + switch (ev->data.keyDown.chr) { + case vchrHard4: + _lastKey = kKeyNone; + event.type = EVENT_RBUTTONDOWN; + event.mouse.x = _mouseCurState.x; + event.mouse.y = _mouseCurState.y; + return true; + + // trun off + case vchrAutoOff: + case vchrPowerOff: + // pause the sound thread if any + if (_sound.active) + SndStreamPause(_soundEx.handle, true); + break; + + case vchrLateWakeup: + // resume the sound thread if any + if (_sound.active) + SndStreamPause(_soundEx.handle, false); + break; + } + + if (_keyMouse.hasMore) { + switch (ev->data.keyDown.chr) { + // hot swap gfx + case vchrHard1: + if (OPTIONS_TST(kOptCollapsible)) + hotswap_gfx_mode(_mode == GFX_WIDE ? GFX_NORMAL: GFX_WIDE); + return false; // not a key + + // ESC key + case vchrHard2: + _lastKey = kKeyNone; + event.type = EVENT_KEYDOWN; + event.kbd.keycode = 27; + event.kbd.ascii = 27; + event.kbd.flags = 0; + return true; + + // F5 = menu + case vchrHard3: + _lastKey = kKeyNone; + event.type = EVENT_KEYDOWN; + event.kbd.keycode = 319; + event.kbd.ascii = 319; + event.kbd.flags = 0; + return true; + } + } + } + + return false; } |