From 01fdeba50a219021ec8076db3a780a89596ad7ea Mon Sep 17 00:00:00 2001 From: Chris Apers Date: Mon, 23 Jan 2006 19:23:52 +0000 Subject: New OS5 backend : - 16bit support - Added SetWindowCaption function - New 'no thread' sound code - Wide mode support - OSD support svn-id: r20145 --- backends/PalmOS/Src/os5_event.cpp | 69 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-) (limited to 'backends/PalmOS/Src/os5_event.cpp') 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; } -- cgit v1.2.3