2012-04-29 23:27:12 +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.
|
|
|
|
*
|
|
|
|
* 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.
|
2014-02-18 01:34:26 +00:00
|
|
|
*
|
2012-04-29 23:27:12 +00:00
|
|
|
* 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.
|
2014-02-18 01:34:26 +00:00
|
|
|
*
|
2012-04-29 23:27:12 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
*/
|
2012-05-14 05:43:50 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* This code is based on original Tony Tough source code
|
|
|
|
*
|
|
|
|
* Copyright (c) 1997-2003 Nayma Software
|
|
|
|
*/
|
2012-04-29 23:27:12 +00:00
|
|
|
|
|
|
|
#ifndef TONY_INPUT_H
|
|
|
|
#define TONY_INPUT_H
|
|
|
|
|
2012-05-06 06:39:42 +00:00
|
|
|
#include "common/events.h"
|
2012-10-31 23:51:42 +00:00
|
|
|
#include "common/rect.h"
|
|
|
|
#include "common/array.h"
|
|
|
|
#include "common/keyboard.h"
|
2012-04-29 23:27:12 +00:00
|
|
|
#include "tony/utils.h"
|
|
|
|
|
|
|
|
namespace Tony {
|
|
|
|
|
|
|
|
class RMInput {
|
|
|
|
private:
|
2012-05-06 06:39:42 +00:00
|
|
|
Common::Event _event;
|
2012-04-29 23:27:12 +00:00
|
|
|
|
2012-05-12 10:49:36 +00:00
|
|
|
// Mouse related fields
|
2012-10-31 23:51:42 +00:00
|
|
|
Common::Point _mousePos;
|
2012-05-06 06:39:42 +00:00
|
|
|
bool _leftClickMouse, _leftReleaseMouse, _rightClickMouse, _rightReleaseMouse;
|
2012-04-29 23:27:12 +00:00
|
|
|
|
2012-05-12 10:49:36 +00:00
|
|
|
// Keyboard related fields
|
2012-10-31 23:51:42 +00:00
|
|
|
Common::Array<Common::KeyCode> _keyDown;
|
2012-05-14 19:29:27 +00:00
|
|
|
|
2012-04-29 23:27:12 +00:00
|
|
|
public:
|
|
|
|
RMInput();
|
|
|
|
|
2012-06-17 17:39:58 +00:00
|
|
|
/**
|
|
|
|
* Polling (must be performed once per frame)
|
|
|
|
*/
|
2012-06-18 06:24:33 +00:00
|
|
|
void poll();
|
2012-04-29 23:27:12 +00:00
|
|
|
|
2012-06-17 17:39:58 +00:00
|
|
|
/**
|
|
|
|
* Reading of the mouse
|
|
|
|
*/
|
2012-09-01 00:27:31 +00:00
|
|
|
RMPoint mousePos();
|
2012-04-29 23:27:12 +00:00
|
|
|
|
2012-06-17 17:39:58 +00:00
|
|
|
/**
|
|
|
|
* Events of mouse clicks
|
|
|
|
*/
|
2012-09-01 00:27:31 +00:00
|
|
|
bool mouseLeftClicked();
|
|
|
|
bool mouseRightClicked();
|
|
|
|
bool mouseLeftReleased();
|
|
|
|
bool mouseRightReleased();
|
2012-04-29 23:27:12 +00:00
|
|
|
|
2012-06-17 17:39:58 +00:00
|
|
|
/**
|
|
|
|
* Returns true if the given key is pressed
|
|
|
|
*/
|
2012-06-04 22:02:15 +00:00
|
|
|
bool getAsyncKeyState(Common::KeyCode kc);
|
2012-04-29 23:27:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End of namespace Tony
|
|
|
|
|
|
|
|
#endif
|