From c40211891afca359784b38e5791ca3db5b419945 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sat, 9 Jul 2011 23:06:37 +0200 Subject: [PATCH] Allow broader range of key triggers for gestures, compatible with Phoenix. Fixes FIRE-1104 --- indra/newview/llpreviewgesture.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp index 8e5beb33ce..8a31b20f6d 100644 --- a/indra/newview/llpreviewgesture.cpp +++ b/indra/newview/llpreviewgesture.cpp @@ -499,9 +499,17 @@ void LLPreviewGesture::addKeys() LLComboBox* combo = mKeyCombo; combo->add( NONE_LABEL ); - for (KEY key = KEY_F2; key <= KEY_F12; key++) + for (KEY key = ' '; key < KEY_NONE; key++) { - combo->add( LLKeyboard::stringFromKey(key), ADD_BOTTOM ); + char buffer[] = {key, '\0'}; + std::string str_org(buffer); + std::string str_translated = LLKeyboard::stringFromKey(key); + + if (str_org == str_translated) + { + if (key >= ' ' && key <= '~') combo->add( str_translated, ADD_BOTTOM ); + } + else combo->add( str_translated, ADD_BOTTOM ); } combo->setCurrentByIndex(0); }