aboutsummaryrefslogtreecommitdiff
path: root/queen/input.h
diff options
context:
space:
mode:
authorGregory Montoir2004-12-31 00:25:18 +0000
committerGregory Montoir2004-12-31 00:25:18 +0000
commita44e8248159fc836f9d534872b0d55741f0c803c (patch)
tree47df2cacddf071f0ff1c8a761b3038acc0d8c7d1 /queen/input.h
parentf06348440fd2040cb8bf57849c7e6670db91caf0 (diff)
downloadscummvm-rg350-a44e8248159fc836f9d534872b0d55741f0c803c.tar.gz
scummvm-rg350-a44e8248159fc836f9d534872b0d55741f0c803c.tar.bz2
scummvm-rg350-a44e8248159fc836f9d534872b0d55741f0c803c.zip
added some comments and re-indented some parts of code
svn-id: r16394
Diffstat (limited to 'queen/input.h')
-rw-r--r--queen/input.h204
1 files changed, 102 insertions, 102 deletions
diff --git a/queen/input.h b/queen/input.h
index bc50ccfe9e..7dc2f1c5b4 100644
--- a/queen/input.h
+++ b/queen/input.h
@@ -30,146 +30,146 @@ class OSystem;
namespace Queen {
class Input {
+public:
- public:
+ //! Adjust here to change delays!
+ enum {
+ DELAY_SHORT = 10,
+ DELAY_NORMAL = 100,
+ DELAY_SCREEN_BLANKER = 5 * 60 * 1000
+ };
+ enum {
+ MOUSE_LBUTTON = 1,
+ MOUSE_RBUTTON = 2
+ };
- //! Adjust here to change delays!
- enum {
- DELAY_SHORT = 10,
- DELAY_NORMAL = 100,
- DELAY_SCREEN_BLANKER = 5 * 60 * 1000
- };
+ Input(Language language, OSystem *system);
- enum {
- MOUSE_LBUTTON = 1,
- MOUSE_RBUTTON = 2
- };
+ //! calls the other delay() with a value adjusted depending on _fastMode
+ void delay();
- Input(Language language, OSystem *system);
+ //! moved QueenEngine::delay() here
+ void delay(uint amount);
- //! calls the other delay() with a value adjusted depending on _fastMode
- void delay();
+ //! convert input to verb
+ int checkKeys();
- //! moved QueenEngine::delay() here
- void delay(uint amount);
+ //! use instead of KEYVERB=0
+ void clearKeyVerb() { _keyVerb = VERB_NONE; }
- //! convert input to verb
- int checkKeys();
+ void canQuit(bool cq) { _canQuit = cq; }
- //! use instead of KEYVERB=0
- void clearKeyVerb() { _keyVerb = VERB_NONE; }
+ bool cutawayRunning() const { return _cutawayRunning; }
+ void cutawayRunning(bool running) { _cutawayRunning = running; }
- void canQuit(bool cq) { _canQuit = cq; }
+ bool cutawayQuit() const { return _cutawayQuit; }
+ void cutawayQuitReset() { _cutawayQuit = false; }
- bool cutawayRunning() const { return _cutawayRunning; }
- void cutawayRunning(bool running) { _cutawayRunning = running; }
+ void dialogueRunning(bool running) { _dialogueRunning = running; }
- bool cutawayQuit() const { return _cutawayQuit; }
- void cutawayQuitReset() { _cutawayQuit = false; }
+ bool talkQuit() const { return _talkQuit; }
+ void talkQuitReset() { _talkQuit = false; }
- void dialogueRunning(bool running) { _dialogueRunning = running; }
+ bool quickSave() const { return _quickSave; }
+ void quickSaveReset() { _quickSave = false; }
+ bool quickLoad() const { return _quickLoad; }
+ void quickLoadReset() { _quickLoad = false; }
+ bool debugger() const { return _debugger; }
+ void debuggerReset() { _debugger = false; }
- bool talkQuit() const { return _talkQuit; }
- void talkQuitReset() { _talkQuit = false; }
+ bool fastMode() const { return _fastMode; }
+ void fastMode(bool fm) { _fastMode = fm; }
- bool quickSave() const { return _quickSave; }
- void quickSaveReset() { _quickSave = false; }
- bool quickLoad() const { return _quickLoad; }
- void quickLoadReset() { _quickLoad = false; }
- bool debugger() const { return _debugger; }
- void debuggerReset() { _debugger = false; }
+ Verb keyVerb() const { return _keyVerb; }
- bool fastMode() const { return _fastMode; }
- void fastMode(bool fm) { _fastMode = fm; }
+ int mousePosX() const { return _mouse_x; }
+ int mousePosY() const { return _mouse_y; }
- Verb keyVerb() const { return _keyVerb; }
+ int mouseButton() const { return _mouseButton; }
+ void clearMouseButton() { _mouseButton = 0; }
- int mousePosX() const { return _mouse_x; }
- int mousePosY() const { return _mouse_y; }
+ //! returns user idle time (used by Display, to trigger the screensaver)
+ uint32 idleTime() const { return _idleTime; }
- int mouseButton() const { return _mouseButton; }
- void clearMouseButton() { _mouseButton = 0; }
+private:
- uint32 idleTime() const { return _idleTime; }
-
- private:
-
- enum KeyCode {
- KEY_SPACE = ' ',
- KEY_COMMA = ',',
- KEY_DOT = '.',
-
- KEY_DIGIT_1 = '1',
- KEY_DIGIT_2 = '2',
- KEY_DIGIT_3 = '3',
- KEY_DIGIT_4 = '4',
-
- KEY_ESCAPE = 27,
- KEY_RETURN = 13,
- KEY_BACKSPACE = 8,
+ enum KeyCode {
+ KEY_SPACE = ' ',
+ KEY_COMMA = ',',
+ KEY_DOT = '.',
+
+ KEY_DIGIT_1 = '1',
+ KEY_DIGIT_2 = '2',
+ KEY_DIGIT_3 = '3',
+ KEY_DIGIT_4 = '4',
+
+ KEY_ESCAPE = 27,
+ KEY_RETURN = 13,
+ KEY_BACKSPACE = 8,
- KEY_F1 = 282,
- KEY_F11 = KEY_F1 + 10,
- KEY_F5 = KEY_F1 + 4,
- KEY_F12
- };
-
- enum {
- LANGUAGE_COUNT = 6
- };
+ KEY_F1 = 282,
+ KEY_F11 = KEY_F1 + 10,
+ KEY_F5 = KEY_F1 + 4,
+ KEY_F12
+ };
+
+ enum {
+ LANGUAGE_COUNT = 6
+ };
- //! Used to get keyboard and mouse events
- OSystem *_system;
+ //! used to get keyboard and mouse events
+ OSystem *_system;
- //! Some cutaways require update() run faster
- bool _fastMode;
+ //! some cutaways require update() run faster
+ bool _fastMode;
- //! The current verb received from keyboard
- Verb _keyVerb;
+ //! the current verb received from keyboard
+ Verb _keyVerb;
- //! set if a cutaway is running
- bool _cutawayRunning;
+ //! set if a cutaway is running
+ bool _cutawayRunning;
- //! set this if we can quit
- bool _canQuit;
+ //! set this if we can quit
+ bool _canQuit;
- //! moved Cutaway::_quit here
- bool _cutawayQuit;
+ //! moved Cutaway::_quit here
+ bool _cutawayQuit;
- //! set if a dialogue is running
- bool _dialogueRunning;
+ //! set if a dialogue is running
+ bool _dialogueRunning;
- //! moved Talk::_quit here
- bool _talkQuit;
+ //! moved Talk::_quit here
+ bool _talkQuit;
- //! Set if quicksave requested
- bool _quickSave;
+ //! set if quicksave requested
+ bool _quickSave;
- //! Set if quickload requested
- bool _quickLoad;
+ //! set if quickload requested
+ bool _quickLoad;
- //! Set if debugger requested
- bool _debugger;
+ //! set if debugger requested
+ bool _debugger;
- //! Set by delay();
- int _inKey;
+ //! set by delay();
+ int _inKey;
- //! Set by delay();
- int _mouse_x, _mouse_y;
+ //! set by delay();
+ int _mouse_x, _mouse_y;
- //! Set by delay();
- int _mouseButton;
+ //! set by delay();
+ int _mouseButton;
- uint32 _idleTime;
+ //! user idle time
+ uint32 _idleTime;
- //! Command keys for current language
- const char *_currentCommandKeys;
+ //! command keys for current language
+ const char *_currentCommandKeys;
- //! Command keys for all languages
- static const char *_commandKeys[LANGUAGE_COUNT];
+ //! command keys for all languages
+ static const char *_commandKeys[LANGUAGE_COUNT];
- //! Verbs matching the command keys
- static const Verb _verbKeys[8];
+ //! verbs matching the command keys
+ static const Verb _verbKeys[8];
};
} // End of namespace Queen