Allow pretty much any key for gestures, like Emerald

This commit is contained in:
Siana Gearz
2012-02-06 03:01:15 +01:00
parent f0d6200e8e
commit 8a49d4ef94

View File

@@ -567,20 +567,23 @@ void LLPreviewGesture::addModifiers()
combo->setCurrentByIndex(0); combo->setCurrentByIndex(0);
} }
static const std::string valid_key_to_string(KEY key)
{
std::string skey(1,(char)key);
std::string strkey = LLKeyboard::stringFromKey(key);
return ((skey == strkey && key >= ' ' && key <= '~') || (skey != strkey) ) ? strkey : "";
}
void LLPreviewGesture::addKeys() void LLPreviewGesture::addKeys()
{ {
LLComboBox* combo = mKeyCombo; LLComboBox* combo = mKeyCombo;
combo->add( NONE_LABEL ); combo->add( NONE_LABEL );
for (KEY key = ' '; key < KEY_NONE; key++)
// <edit> {
//define for the lulz std::string keystr = valid_key_to_string(key);
#define addKey(k) combo->add( LLKeyboard::stringFromKey(k), ADD_BOTTOM ); if(keystr != "")combo->add( keystr, ADD_BOTTOM );
for (KEY key = KEY_F2; key <= KEY_F12; key++) }
addKey(key)
for (KEY key = ' '; key <= '~'; key++)
addKey(key)
// </edit>
combo->setCurrentByIndex(0); combo->setCurrentByIndex(0);
} }