This commit is contained in:
wu58430 2023-12-04 20:16:29 +08:00
parent e2f93c2ca9
commit 988ee09c84

View file

@ -1642,18 +1642,14 @@ static void MENU_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction)
uint8_t VFO;
uint8_t Channel;
bool bCheckScanList;
if (UI_MENU_GetCurrentMenuId() == MENU_MEM_NAME && gIsInSubMenu && edit_index >= 0)
{ // change the character
if (bKeyPressed && edit_index < 10 && Direction != 0)
{
if(&& gIsInSubMenu && edit_index >= 0){
if (UI_MENU_GetCurrentMenuId() == MENU_MEM_NAME) { // change the character
if (bKeyPressed && edit_index < 10 && Direction != 0) {
const char unwanted[] = "$%&!\"':;?^`|{}";
char c = edit[edit_index] + Direction;
unsigned int i = 0;
while (i < sizeof(unwanted) && c >= 32 && c <= 126)
{
if (c == unwanted[i++])
{ // choose next character
while (i < sizeof(unwanted) && c >= 32 && c <= 126) {
if (c == unwanted[i++]) { // choose next character
c += Direction;
i = 0;
}
@ -1663,8 +1659,19 @@ static void MENU_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction)
gRequestDisplayScreen = DISPLAY_MENU;
}
return;
} else if (UI_MENU_GetCurrentMenuId() == MENU_MDC_ID)
{
if (bKeyPressed && edit_index < 4 && Direction != 0) {
char c = edit[edit_index] + Direction;
if(c<'0')c='F';
else if(c>'9')c='A';
else if(c<'A')c='9';
else if(c>'F')c='0';
gRequestDisplayScreen = DISPLAY_MENU;
}
return;
}
}
if (!bKeyHeld)
{
if (!bKeyPressed)