2007-05-30 21:56:52 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
2005-03-31 05:35:04 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2005-10-18 01:30:26 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2005-03-31 05:35:04 +00:00
|
|
|
*
|
2006-02-11 12:47:47 +00:00
|
|
|
* $URL$
|
|
|
|
* $Id$
|
2005-03-31 05:35:04 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __PS2INPUT_H__
|
|
|
|
#define __PS2INPUT_H__
|
|
|
|
|
|
|
|
#include "common/system.h"
|
2008-03-03 00:41:59 +00:00
|
|
|
#include "common/keyboard.h"
|
2005-03-31 05:35:04 +00:00
|
|
|
|
|
|
|
class OSystem_PS2;
|
|
|
|
class Ps2Pad;
|
|
|
|
|
|
|
|
class Ps2Input {
|
|
|
|
public:
|
|
|
|
Ps2Input(OSystem_PS2 *system, bool mouseLoaded, bool kbdLoaded);
|
|
|
|
~Ps2Input(void);
|
|
|
|
void newRange(uint16 minx, uint16 miny, uint16 maxx, uint16 maxy);
|
2007-03-17 19:02:05 +00:00
|
|
|
bool pollEvent(Common::Event *event);
|
2005-03-31 05:35:04 +00:00
|
|
|
void warpTo(uint16 x, uint16 y);
|
|
|
|
private:
|
|
|
|
int mapKey(int key, int mod);
|
2007-03-17 19:02:05 +00:00
|
|
|
bool getKeyEvent(Common::Event *event, uint16 buttonCode, bool down);
|
2005-03-31 05:35:04 +00:00
|
|
|
OSystem_PS2 *_system;
|
|
|
|
Ps2Pad *_pad;
|
|
|
|
|
|
|
|
uint16 _minx, _maxx, _miny, _maxy;
|
|
|
|
|
|
|
|
uint16 _posX, _posY;
|
|
|
|
uint16 _mButtons;
|
|
|
|
uint16 _padLastButtons;
|
|
|
|
uint32 _lastPadCheck;
|
|
|
|
uint16 _padAccel;
|
|
|
|
|
|
|
|
bool _mouseLoaded, _kbdLoaded;
|
|
|
|
int _keyFlags;
|
2008-03-03 00:41:59 +00:00
|
|
|
static const Common::KeyCode _padCodes[16], _padFlags[16];
|
|
|
|
static const Common::KeyCode _usbToSdlk[0x100];
|
2005-03-31 05:35:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __PS2INPUT_H__
|
|
|
|
|