diff options
| author | Oz Linden <oz@lindenlab.com> | 2011-01-04 16:43:26 -0500 |
|---|---|---|
| committer | Oz Linden <oz@lindenlab.com> | 2011-01-04 16:43:26 -0500 |
| commit | 05810f063dbe0ed87d03ea41c7d8fdc423945c6e (patch) | |
| tree | 311355a1679ef47fa1951788319e0c521a188edd /indra/newview/llviewerkeyboard.h | |
| parent | 5e376017858f6534163b0bfb6b385bdd0aeac5d3 (diff) | |
| parent | e4591a85182133811e327b579c558bb3db80d79e (diff) | |
merge changes for storm-737
Diffstat (limited to 'indra/newview/llviewerkeyboard.h')
| -rw-r--r-- | indra/newview/llviewerkeyboard.h | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/indra/newview/llviewerkeyboard.h b/indra/newview/llviewerkeyboard.h index 2fa5d5dfa6..925244e89b 100644 --- a/indra/newview/llviewerkeyboard.h +++ b/indra/newview/llviewerkeyboard.h @@ -55,26 +55,51 @@ typedef enum e_keyboard_mode void bind_keyboard_functions(); - class LLViewerKeyboard { public: + struct KeyBinding : public LLInitParam::Block<KeyBinding> + { + Mandatory<std::string> key, + mask, + command; + + KeyBinding(); + }; + + struct KeyMode : public LLInitParam::Block<KeyMode> + { + Multiple<KeyBinding> bindings; + EKeyboardMode mode; + KeyMode(EKeyboardMode mode); + }; + + struct Keys : public LLInitParam::Block<Keys> + { + Optional<KeyMode> first_person, + third_person, + edit, + sitting, + edit_avatar; + + Keys(); + }; + LLViewerKeyboard(); BOOL handleKey(KEY key, MASK mask, BOOL repeated); - void bindNamedFunction(const std::string& name, LLKeyFunc func); - S32 loadBindings(const std::string& filename); // returns number bound, 0 on error + S32 loadBindingsXML(const std::string& filename); // returns number bound, 0 on error EKeyboardMode getMode(); BOOL modeFromString(const std::string& string, S32 *mode); // False on failure void scanKey(KEY key, BOOL key_down, BOOL key_up, BOOL key_level); -protected: + +private: + S32 loadBindingMode(const LLViewerKeyboard::KeyMode& keymode); BOOL bindKey(const S32 mode, const KEY key, const MASK mask, const std::string& function_name); - S32 mNamedFunctionCount; - LLNamedFunction mNamedFunctions[MAX_NAMED_FUNCTIONS]; // Hold all the ugly stuff torn out to make LLKeyboard non-viewer-specific here S32 mBindingCount[MODE_COUNT]; |
