driver/rcinput: let getUnicodeValue() return const char *

This commit is contained in:
martii
2014-02-23 10:26:34 +01:00
committed by svenhoefer
parent 7826ab0fca
commit 34c23ed7a5
4 changed files with 21 additions and 27 deletions

View File

@@ -430,7 +430,7 @@ int CStringInput::exec( CMenuTarget* parent, const std::string & )
{
keyRightPressed();
}
else if (CRCInput::getUnicodeValue(msg) != -1)
else if (*CRCInput::getUnicodeValue(msg))
{
NormalKeyPressed(msg);
}
@@ -701,7 +701,7 @@ void CStringInputSMS::NormalKeyPressed(const neutrino_msg_t key)
}
else
{
valueString->at(selected) = (char)CRCInput::getUnicodeValue(key);
valueString->at(selected) = *CRCInput::getUnicodeValue(key);
keyRedPressed(); /* to lower, paintChar */
keyRightPressed(); /* last_digit = -1, move to next position */
}

View File

@@ -218,7 +218,7 @@ int CExtendedInput::exec( CMenuTarget* parent, const std::string & )
CVFD::getInstance()->showMenuText(1, valueString->c_str(), selectedChar+1);
}
}
else if ( (CRCInput::getUnicodeValue(msg) != -1) || (msg == CRCInput::RC_red) || (msg == CRCInput::RC_green) || (msg == CRCInput::RC_blue) || (msg == CRCInput::RC_yellow)
else if ( (!*CRCInput::getUnicodeValue(msg)) || (msg == CRCInput::RC_red) || (msg == CRCInput::RC_green) || (msg == CRCInput::RC_blue) || (msg == CRCInput::RC_yellow)
|| (msg == CRCInput::RC_up) || (msg == CRCInput::RC_down))
{
inputFields[selectedChar]->keyPressed(msg);
@@ -377,12 +377,12 @@ int CExtendedInput_Item_Char::getCharID( char ch )
void CExtendedInput_Item_Char::keyPressed(const int key)
{
int value = CRCInput::getUnicodeValue(key);
if (value != -1)
const char *value = CRCInput::getUnicodeValue(key);
if (*value)
{
if (isAllowedChar((char)value))
if (isAllowedChar(*value))
{
*data = (char)value;
*data = *value;
g_RCInput->postMsg( CRCInput::RC_right, 0 );
}
}