From 7f003fa20df6ed60532271084696076ee61128de Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 30 Sep 2010 16:43:44 -0700 Subject: converted keys.ini to keys.xml and use LLInitParam parsing --- indra/newview/llviewerkeyboard.h | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewerkeyboard.h') diff --git a/indra/newview/llviewerkeyboard.h b/indra/newview/llviewerkeyboard.h index 2fa5d5dfa6..6e758cc7b3 100644 --- a/indra/newview/llviewerkeyboard.h +++ b/indra/newview/llviewerkeyboard.h @@ -55,10 +55,36 @@ typedef enum e_keyboard_mode void bind_keyboard_functions(); - class LLViewerKeyboard { public: + struct KeyBinding : public LLInitParam::Block + { + Mandatory key, + mask, + command; + + KeyBinding(); + }; + + struct KeyMode : public LLInitParam::Block + { + Multiple bindings; + EKeyboardMode mode; + KeyMode(EKeyboardMode mode); + }; + + struct Keys : public LLInitParam::Block + { + Optional first_person, + third_person, + edit, + sitting, + edit_avatar; + + Keys(); + }; + LLViewerKeyboard(); BOOL handleKey(KEY key, MASK mask, BOOL repeated); @@ -66,13 +92,17 @@ public: 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]; -- cgit v1.2.3 From a5e0c51de9acdbffa385c1fc6c8d6e7a18c9908a Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 30 Sep 2010 20:07:50 -0700 Subject: custom skylight key bindings --- indra/newview/llviewerkeyboard.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'indra/newview/llviewerkeyboard.h') diff --git a/indra/newview/llviewerkeyboard.h b/indra/newview/llviewerkeyboard.h index 6e758cc7b3..925244e89b 100644 --- a/indra/newview/llviewerkeyboard.h +++ b/indra/newview/llviewerkeyboard.h @@ -89,8 +89,6 @@ public: 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(); @@ -103,9 +101,6 @@ 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]; LLKeyBinding mBindings[MODE_COUNT][MAX_KEY_BINDINGS]; -- cgit v1.2.3