aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Montoir2003-10-28 20:58:46 +0000
committerGregory Montoir2003-10-28 20:58:46 +0000
commitefa51b6013eb3d95cb86e430e4158cf5821cd3a9 (patch)
treeec78358421251a0daf87886a60f70243ad09924a
parent8eea63362ed29d888515512f965a298e5cb77bd6 (diff)
downloadscummvm-rg350-efa51b6013eb3d95cb86e430e4158cf5821cd3a9.tar.gz
scummvm-rg350-efa51b6013eb3d95cb86e430e4158cf5821cd3a9.tar.bz2
scummvm-rg350-efa51b6013eb3d95cb86e430e4158cf5821cd3a9.zip
add accessors for mouse current pos / button + keyVerb
svn-id: r10999
-rw-r--r--queen/input.cpp10
-rw-r--r--queen/input.h25
-rw-r--r--queen/xref.txt8
3 files changed, 31 insertions, 12 deletions
diff --git a/queen/input.cpp b/queen/input.cpp
index fb3ea046f2..b1b86d3130 100644
--- a/queen/input.cpp
+++ b/queen/input.cpp
@@ -56,19 +56,21 @@ void Input::delay(uint amount) {
break;
case OSystem::EVENT_MOUSEMOVE:
- _sdl_mouse_x = event.mouse.x;
- _sdl_mouse_y = event.mouse.y;
+ _mouse_x = event.mouse.x;
+ _mouse_y = event.mouse.y;
break;
case OSystem::EVENT_LBUTTONDOWN:
+ _mouseButton |= MOUSE_LBUTTON;
#ifdef _WIN32_WCE
- _sdl_mouse_x = event.mouse.x;
- _sdl_mouse_y = event.mouse.y;
+ _mouse_x = event.mouse.x;
+ _mouse_y = event.mouse.y;
#endif
break;
case OSystem::EVENT_RBUTTONDOWN:
+ _mouseButton |= MOUSE_RBUTTON;
break;
case OSystem::EVENT_QUIT:
diff --git a/queen/input.h b/queen/input.h
index 75bdc98920..fd97df91b3 100644
--- a/queen/input.h
+++ b/queen/input.h
@@ -35,10 +35,15 @@ class Input {
//! Adjust here to change delays!
enum {
- DELAY_SHORT = 10,
+ DELAY_SHORT = 10,
DELAY_NORMAL = 100
};
+ enum {
+ MOUSE_LBUTTON = 1,
+ MOUSE_RBUTTON = 2
+ };
+
Input(OSystem *system);
//! calls the other delay() with a value adjusted depending on _fastMode
@@ -80,16 +85,25 @@ class Input {
void canQuit(bool cq) { _canQuit = cq; }
+ bool cutawayRunning() const { return _cutawayRunning; }
void cutawayRunning(bool running) { _cutawayRunning = running; }
- bool cutawayQuit() { return _cutawayQuit; }
+ bool cutawayQuit() const { return _cutawayQuit; }
void cutawayQuitReset() { _cutawayQuit = false; }
- bool talkQuit() { return _talkQuit; }
+ bool talkQuit() const { return _talkQuit; }
void talkQuitReset() { _talkQuit = false; }
void fastMode(bool fm) { _fastMode = fm; }
+ Verb keyVerb() const { return _keyVerb; }
+
+ int mousePosX() const { return _mouse_x; }
+ int mousePosY() const { return _mouse_y; }
+
+ int mouseButton() const { return _mouseButton; }
+ void clearMouseButton() { _mouseButton = 0; }
+
private:
enum KeyCode {
@@ -132,7 +146,10 @@ class Input {
int _inKey;
//! Set by delay();
- int _sdl_mouse_x, _sdl_mouse_y;
+ int _mouse_x, _mouse_y;
+
+ //! Set by delay();
+ int _mouseButton;
};
diff --git a/queen/xref.txt b/queen/xref.txt
index 7360c6a63b..b051bdd603 100644
--- a/queen/xref.txt
+++ b/queen/xref.txt
@@ -47,6 +47,7 @@ COM_LIST Command::_cmdList
COM_LIST_MAX Command::_numCmdList
COMMANDstr Command::_command
DEFCOMM Command::_defaultVerb
+MKEY Command::_mouseKey
OLDVERB,VERB Command::_*verb*
OLDNOUN,NOUN,NOUN2 Command::_*noun*
PARSE Command::_parse
@@ -152,11 +153,10 @@ check_keys() Input::checkKeys()
get_key() *not needed*
-
drawmouseflag
-key_commands
-key_language
+key_commands Input::?
+key_language Input::?
KEYVERB Input::_keyVerb
-MKEY
-MouseButton
+MouseButton Input::_mouseButton
mouseflag
no_check_keys Input::_noCheckKeys