summaryrefslogtreecommitdiff
path: root/indra/llwindow
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llwindow')
-rw-r--r--indra/llwindow/llmousehandler.h6
-rw-r--r--indra/llwindow/llwindow.cpp14
-rw-r--r--indra/llwindow/llwindow.h5
-rw-r--r--indra/llwindow/llwindowwin32.cpp86
-rw-r--r--indra/llwindow/llwindowwin32.h3
5 files changed, 24 insertions, 90 deletions
diff --git a/indra/llwindow/llmousehandler.h b/indra/llwindow/llmousehandler.h
index e59b5845b0..1df1609451 100644
--- a/indra/llwindow/llmousehandler.h
+++ b/indra/llwindow/llmousehandler.h
@@ -15,8 +15,6 @@
// Intended for use via multiple inheritance.
// A class may have as many interfaces as it likes, but never needs to inherit one more than once.
-#include "llstring.h"
-
class LLMouseHandler
{
public:
@@ -33,11 +31,15 @@ public:
virtual BOOL handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect_screen) = 0;
virtual const LLString& getName() const = 0;
+ virtual void onMouseCaptureLost() = 0;
+
// Hack to support LLFocusMgr
virtual BOOL isView() = 0;
virtual void screenPointToLocal(S32 screen_x, S32 screen_y, S32* local_x, S32* local_y) const = 0;
virtual void localPointToScreen(S32 local_x, S32 local_y, S32* screen_x, S32* screen_y) const = 0;
+
+ virtual BOOL hasMouseCapture() = 0;
};
#endif
diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp
index ccc100a861..f7df94c65c 100644
--- a/indra/llwindow/llwindow.cpp
+++ b/indra/llwindow/llwindow.cpp
@@ -217,6 +217,11 @@ LLWindow::LLWindow(BOOL fullscreen, U32 flags)
{
mJoyAxis[i] = 0;
}
+
+ for (U32 i = 0; i < 16; i++)
+ {
+ mJoyButtonState[i] = 0;
+ }
}
// virtual
@@ -243,6 +248,15 @@ F32 LLWindow::getJoystickAxis(U32 axis)
return 0.f;
}
+U8 LLWindow::getJoystickButton(U32 button)
+{
+ if (button < 16)
+ {
+ return mJoyButtonState[button];
+ }
+ return 0;
+}
+
void LLWindow::setCallbacks(LLWindowCallbacks *callbacks)
{
mCallbacks = callbacks;
diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h
index f19178d7f5..5c5f712b32 100644
--- a/indra/llwindow/llwindow.h
+++ b/indra/llwindow/llwindow.h
@@ -183,6 +183,8 @@ public:
virtual void setNativeAspectRatio(F32 aspect) = 0;
F32 getJoystickAxis(U32 axis);
+ U8 getJoystickButton(U32 button);
+
void setCallbacks(LLWindowCallbacks *callbacks);
virtual void beforeDialog() {}; // prepare to put up an OS dialog (if special measures are required, such as in fullscreen mode)
@@ -221,7 +223,8 @@ protected:
BOOL mHideCursorPermanent;
U32 mFlags;
F32 mJoyAxis[6];
-
+ U8 mJoyButtonState[16];
+
friend class LLWindowManager;
};
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index b8123096e6..697b8f2175 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -744,8 +744,6 @@ LLWindowWin32::LLWindowWin32(char *title, char *name, S32 x, S32 y, S32 width,
}
SetTimer( mWindowHandle, 0, 1000 / 30, NULL ); // 30 fps timer
- mJoyStickState = 0;
- mJoyButtonState = 0;
}
@@ -2803,89 +2801,9 @@ void LLWindowWin32::updateJoystick( )
mJoyAxis[4] = js.lRy/1000.f;
mJoyAxis[5] = js.lRz/1000.f;
- if (js.lX <= -500)
+ for (U32 i = 0; i < 16; i++)
{
- if (!(mJoyStickState & 0x1))
- {
- gKeyboard->handleTranslatedKeyDown(KEY_PAD_LEFT, 0);
- mJoyStickState |= 0x1;
- }
- }
- else
- {
- if (mJoyStickState & 0x1)
- {
- gKeyboard->handleTranslatedKeyUp(KEY_PAD_LEFT, 0);
- mJoyStickState &= ~0x1;
- }
- }
- if (js.lX >= 500)
- {
- if (!(mJoyStickState & 0x2))
- {
- gKeyboard->handleTranslatedKeyDown(KEY_PAD_RIGHT, 0);
- mJoyStickState |= 0x2;
- }
- }
- else
- {
- if (mJoyStickState & 0x2)
- {
- gKeyboard->handleTranslatedKeyUp(KEY_PAD_RIGHT, 0);
- mJoyStickState &= ~0x2;
- }
- }
- if (js.lY <= -500)
- {
- if (!(mJoyStickState & 0x4))
- {
- gKeyboard->handleTranslatedKeyDown(KEY_PAD_UP, 0);
- mJoyStickState |= 0x4;
- }
- }
- else
- {
- if (mJoyStickState & 0x4)
- {
- gKeyboard->handleTranslatedKeyUp(KEY_PAD_UP, 0);
- mJoyStickState &= ~0x4;
- }
- }
- if (js.lY >= 500)
- {
- if (!(mJoyStickState & 0x8))
- {
- gKeyboard->handleTranslatedKeyDown(KEY_PAD_DOWN, 0);
- mJoyStickState |= 0x8;
- }
- }
- else
- {
- if (mJoyStickState & 0x8)
- {
- gKeyboard->handleTranslatedKeyUp(KEY_PAD_DOWN, 0);
- mJoyStickState &= ~0x8;
- }
- }
-
- for( int i = 0; i < 15; i++ )
- {
- if ( js.rgbButtons[i] & 0x80 )
- {
- if (!(mJoyButtonState & (1<<i)))
- {
- gKeyboard->handleTranslatedKeyDown(KEY_BUTTON1+i, 0);
- mJoyButtonState |= (1<<i);
- }
- }
- else
- {
- if (mJoyButtonState & (1<<i))
- {
- gKeyboard->handleTranslatedKeyUp(KEY_BUTTON1+i, 0);
- mJoyButtonState &= ~(1<<i);
- }
- }
+ mJoyButtonState[i] = js.rgbButtons[i];
}
}
diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h
index ba944ca900..c4391ef41f 100644
--- a/indra/llwindow/llwindowwin32.h
+++ b/indra/llwindow/llwindowwin32.h
@@ -150,9 +150,6 @@ protected:
WORD mPrevGammaRamp[256*3];
WORD mCurrentGammaRamp[256*3];
- U32 mJoyStickState;
- U32 mJoyButtonState;
-
LPWSTR mIconResource;
BOOL mMousePositionModified;
BOOL mInputProcessingPaused;