I am working on getting the NPP squelch using the latest UI from Angband, and I can't figure something out.
Inside the sval squelch menu, I am trying to make it so the player can navigate by menu selections as well as the arrow keys. The original menu.cmd_keys was this:
const char cmd_keys[] = { ARROW_LEFT, ARROW_RIGHT, '\0' };
menu.cmd_keys = cmd_keys;
The up and down arrows worked to navigate the screen, and left and right toggled the settings.
I am trying to do the same thing, except let the player type a single letter to jump to another setting using the menu.selection option.
So I have this in there (I need to reserve ANSL for the 4 NPP squelch settings, and I wanted them to be able to be toggled by + and - as well as the arrow left and right keys:
menu.cmd_keys = "ANLS+-\x8A\x8B\x8C\x8D\n\r"; /* \x8A-D = ARROW DIRECTION KEYS */
menu.selections = "abcdefghijklmnopqrstuvwxyzBCDEFGHIJKMOPRTUVWXYZ12 3467890";
When I add the menu selections line. I lose the use of the arrow up and down keys to navigate. When I comment it out, I lose the arrow up and down keys for navigation. Arrow left and right don't get any response either way.
My sval action is squelch.c looks like this:
switch (cmd)
{
case 'S':
{
k_info[idx].squelch = SQUELCH_ALWAYS;
return (TRUE);
}
case 'L':
{
k_info[idx].squelch = NO_SQUELCH_NEVER_PICKUP;
return (TRUE);
}
case 'A':
{
k_info[idx].squelch = NO_SQUELCH_ALWAYS_PICKUP;
return (TRUE);
}
case 'N':
{
k_info[idx].squelch = SQUELCH_NEVER;
return (TRUE);
}
case '+':
case ARROW_RIGHT:
{
change_squelch_setting(idx, 1);
return TRUE;
}
case '-':
case ARROW_LEFT:
{
change_squelch_setting(idx, -1);
return TRUE;
}
default: break;
}
What am I missing to get all the direction keys and the menu.selection option working at the same time? Thanks.
Inside the sval squelch menu, I am trying to make it so the player can navigate by menu selections as well as the arrow keys. The original menu.cmd_keys was this:
const char cmd_keys[] = { ARROW_LEFT, ARROW_RIGHT, '\0' };
menu.cmd_keys = cmd_keys;
The up and down arrows worked to navigate the screen, and left and right toggled the settings.
I am trying to do the same thing, except let the player type a single letter to jump to another setting using the menu.selection option.
So I have this in there (I need to reserve ANSL for the 4 NPP squelch settings, and I wanted them to be able to be toggled by + and - as well as the arrow left and right keys:
menu.cmd_keys = "ANLS+-\x8A\x8B\x8C\x8D\n\r"; /* \x8A-D = ARROW DIRECTION KEYS */
menu.selections = "abcdefghijklmnopqrstuvwxyzBCDEFGHIJKMOPRTUVWXYZ12 3467890";
When I add the menu selections line. I lose the use of the arrow up and down keys to navigate. When I comment it out, I lose the arrow up and down keys for navigation. Arrow left and right don't get any response either way.
My sval action is squelch.c looks like this:
switch (cmd)
{
case 'S':
{
k_info[idx].squelch = SQUELCH_ALWAYS;
return (TRUE);
}
case 'L':
{
k_info[idx].squelch = NO_SQUELCH_NEVER_PICKUP;
return (TRUE);
}
case 'A':
{
k_info[idx].squelch = NO_SQUELCH_ALWAYS_PICKUP;
return (TRUE);
}
case 'N':
{
k_info[idx].squelch = SQUELCH_NEVER;
return (TRUE);
}
case '+':
case ARROW_RIGHT:
{
change_squelch_setting(idx, 1);
return TRUE;
}
case '-':
case ARROW_LEFT:
{
change_squelch_setting(idx, -1);
return TRUE;
}
default: break;
}
What am I missing to get all the direction keys and the menu.selection option working at the same time? Thanks.
Comment