/* ** input.h ** ** This file is part of mkxp. ** ** Copyright (C) 2013 Jonas Kulla ** ** mkxp 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. ** ** mkxp 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 mkxp. If not, see . */ #ifndef INPUT_H #define INPUT_H struct InputPrivate; struct RGSSThreadData; class Input{ public: enum ButtonCode{ None = 0, Down = 2, Left = 4, Right = 6, Up = 8, Action = 11, Cancel = 12, Menu = 13, Items = 14, Run = 15, Deactivate = 16, L = 17, R = 18, F5 = 25, F6 = 26, F7 = 27, F8 = 28, F9 = 29, /* Non-standard extensions */ MouseLeft = 38, MouseMiddle = 39, MouseRight = 40 }; void update(); bool isPressed(int button); bool isTriggered(int button); bool isRepeated(int button); int dir4Value(); int dir8Value(); /* Non-standard extensions */ int mouseX(); int mouseY(); bool hasQuit(); private: Input(const RGSSThreadData &rtData); ~Input(); friend struct SharedStatePrivate; InputPrivate *p; }; #endif // INPUT_H