ScummVM API documentation
ds-events.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef BACKEND_EVENTS_DS_H
23#define BACKEND_EVENTS_DS_H
24
25#include "common/events.h"
26
27#include "backends/events/default/default-events.h"
28
34 bool _dsReset;
35public:
36 DSEventManager(Common::EventSource *boss) : DefaultEventManager(boss), _dsReset(false) {}
37 bool pollEvent(Common::Event &event) override;
38 int shouldQuit() const override { return _dsReset || DefaultEventManager::shouldQuit(); }
39};
40
45public:
46 DSEventSource() : _firstPoll(true), _handleTouch(true) {}
47
51 virtual bool pollEvent(Common::Event &event);
52
53 virtual void handleTouch(bool enabled) { _handleTouch = enabled; }
54
55protected:
57 Common::Point _lastTouch;
58 bool _firstPoll;
59 bool _handleTouch;
60
61 void addEventsToQueue();
62 void addJoyButtonEvent(u32 keysPressed, u32 keysReleased, u32 ndsKey, uint8 svmButton);
63};
64
65#endif
Definition: events.h:278
Definition: ds-events.h:33
bool pollEvent(Common::Event &event) override
int shouldQuit() const override
Definition: ds-events.h:38
Definition: ds-events.h:44
virtual bool pollEvent(Common::Event &event)
Definition: default-events.h:37
int shouldQuit() const override
Definition: default-events.h:74
Definition: events.h:218
Definition: rect.h:144