diff options
| author | Nat Goodspeed <nat@lindenlab.com> | 2011-03-21 17:38:16 -0400 |
|---|---|---|
| committer | Nat Goodspeed <nat@lindenlab.com> | 2011-03-21 17:38:16 -0400 |
| commit | 3f3429fa6854c6462abf3bbabf4af1dbbeb4c337 (patch) | |
| tree | 4d3b55217c64d0b24da958d1fa6148a974d8475c /indra/llwindow/llwindow.cpp | |
| parent | 930710ceecf32c12af5d6e416a4697f9eb9df8aa (diff) | |
STORM-1051: Fixup to LLWindowListener per code review.
Bug: capturing a const ref to value returned by LLSD::asString() not so good.
Bug: LLWindowListener::keyUp() was calling handleTranslatedKeyDown().
In keyDown and keyUp, support keysym lookup (e.g. "TAB") as well as integer
keycode.
In keyDown, keyUp, mouseDown, mouseUp and mouseMove, support modifier mask by
accepting an array of "CONTROL", "SHIFT" etc. strings.
State in operation doc strings valid values for button, keycode, keysym, mask.
The LLWindowListener(... LLKeyboard*) constructor param gKeyboard is always
NULL at the time LLWindowListener is constructed. Eliminate tests and global
references to gKeyboard by replacing with a more Feathers-style LLKeyboard*
getter function.
Diffstat (limited to 'indra/llwindow/llwindow.cpp')
| -rw-r--r-- | indra/llwindow/llwindow.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp index 2d00c37719..71a5df910d 100644 --- a/indra/llwindow/llwindow.cpp +++ b/indra/llwindow/llwindow.cpp @@ -42,6 +42,7 @@ #include "linked_lists.h" #include "llwindowcallbacks.h" #include "llwindowlistener.h" +#include <boost/lambda/core.hpp> // @@ -117,7 +118,11 @@ LLWindow::LLWindow(LLWindowCallbacks* callbacks, BOOL fullscreen, U32 flags) mFlags(flags), mHighSurrogate(0) { - mListener = new LLWindowListener(callbacks, gKeyboard); + // gKeyboard is still NULL, so it doesn't do LLWindowListener any good to + // pass its value right now. Instead, pass it a nullary function that + // will, when we later need it, return the value of gKeyboard. + // boost::lambda::var() constructs such a functor on the fly. + mListener = new LLWindowListener(callbacks, boost::lambda::var(gKeyboard)); } LLWindow::~LLWindow() |
