Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: jumping to menu item via numbers do not work when ChName is selected #142

Closed
prokrypt opened this issue Jun 18, 2024 · 5 comments
Closed
Labels
bug Something isn't working

Comments

@prokrypt
Copy link

prokrypt commented Jun 18, 2024

Steps to reproduce:

  • Press MENU
  • Press 1 7 to get to ChName
  • Numbers (and * and F) do nothing. It thinks a channel name is being inputted, maybe.

This probably has something to do with edit_index in menu.c. Either it's not being set to -1, or something is changing it.
A fast fix would be to add a check for gIsInSubMenu in each of the affected key functions, but that's not ideal and takes up precious bytes...

@armel armel added the bug Something isn't working label Jun 18, 2024
@prokrypt
Copy link
Author

More interesting things:

  • Press MENU
  • Press 1 7
  • Press MENU
  • Press EXIT
  • Numbers work to jump to other menu items
  • Press 1 7 to get back to ChName
  • Press MENU twice
  • Press EXIT
  • Numbers no longer work.

@prokrypt
Copy link
Author

prokrypt commented Jun 18, 2024

I fixed it by adding edit_index = -1; to app/menu.c, MENU_ShowCurrentSetting function, under case MENU_MEM_NAME:

case MENU_MEM_NAME:

Not sure if that's the correct place, but it's the best I could do...

@prokrypt
Copy link
Author

prokrypt commented Jun 18, 2024

More changes: move edit_index = -1; from

edit_index = -1;

to after/before
gIsInSubMenu = false;

otherwise the same issue occurs when you keep pressing menu until the text input exits.

@prokrypt
Copy link
Author

prokrypt commented Jun 19, 2024

Fixed it with a change in one spot only:

if (!gIsInSubMenu || edit_index < 0)

change if (!gIsInSubMenu || edit_index < 0)
to

if (!gIsInSubMenu)
	edit_index = -1;
if (edit_index < 0)

and edit_index = -1; can be removed in app/menu.c to save a few bytes.

armel added a commit that referenced this issue Jun 25, 2024
@armel
Copy link
Owner

armel commented Jun 25, 2024

Ok, thank you. It will be fixed in the next release.

@armel armel closed this as completed Jun 25, 2024
@armel armel mentioned this issue Jul 4, 2024
prokrypt referenced this issue in nanhantianyi/uv-k5-firmware-custom Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants