I have a single button that needs to allow users to navigate menus and increment selections.

I have tried a few things, but wanted to ask the group for ideas. As usual I'm short on space.

Function 1: Press and Release = Increment
Function 2: Press and Hold = Enter

What I have now works ok until you move onto the next submenu and the value increments right away. (BTW ButtonCnt is tied to TMR1 to count how long the button has been held)

While Switch=0
IF ButtonCnt>30 Then SubMenu=SubMenu+1
Wend

value=value+1

Thoughts on this one?