You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In NetHackW.exe, using $ to select gold from either the D Drop Objects command or the container interface screen does not allow entering a count, like it does with normal objects, or like in the non-gui interface. The work around is to explicitly select gold from the list, either with the mouse or the arrow keys.
I took a brief look at the code, however I'm not familiar with NetHackW or how the menus work. I think the issue is that $ is a group accelerator as well as a standard accelerator, and group accelerators don't allow counts. I don't think $ needs to be a group accelerator, because there should only ever be one item, but I have no idea if this would have other effects.
I'm not sure, because I don't have access to a Windows machine and I haven't dug into the code that carefully, but it looks like onListChar(mhmenu.c) may contain an implicit assumption that all invlets will be alphabetical (which would mean '$' doesn't work as an invlet):
There doesn't seem to be such an assumption for group accelerators, but it looks as though when a group accelerator is used in the MSWin windowport the count is ignored/reset (group accelerators accept counts in TTY afaik, but I guess not in this windowport):
I think the combination of the two things causes the problem.
By the way, the use of '$' as a group accelerator in TTY allows you to select it even when it's offscreen (due to some special handling added in efea46a that allows the group accelerator to take precedence over the invlet), so the dual use of '$' isn't pointless. If NetHackW doesn't have paginated menus maybe that wouldn't provide any benefit, though. :)
I don't think $ needs to be a group accelerator, because there should
only ever be one item, but I have no idea if this would have other effects.
For tty (also curses), menus are paginated. Regular selector characters
only work on the current page, but group accelerators ignore page
boundaries and affect the entire menu.
Treating $ as both the selector 'letter' for gold pieces and as the group
accelerator for coins was done so that gold can be chosen regardless
of what page you're looking at, like group picks of other object classes.
The development code has been changed for tty (also curses, not sure
offhand about any of the other interfaces) to honor a pending count
whenever any group accelerator matches a single item. I think that that
was done primarily to benefit '$'.
Maintenance for the Windows GUI interface is lagging and I don't think
it has had any updates--except for untested attempts to match some
changes that other interfaces have undergone--in quite a while.
@pat-rankin Maybe it's reasonable to allow selector characters to work from any page, too? (Perhaps, on opt-in basis via a new option?). In xNetHack, curses interface allows to select characters from any page and it's IMO a great idea, since with force_invmenu you may already remember the character you want, and if it's not on current page - you're forced to switch pages. This would also allow to get rid of $ as group accelerator.
In xNetHack, curses interface allows to select characters from any page and it's IMO a great idea, since with force_invmenu you may already remember the character you want, and if it's not on current page - you're forced to switch pages.
I'm pretty sure this is behavior from the curses windowport in vanilla NetHack too, not unique to xNetHack -- if you enter an invlet from a different page it scrolls over to that page and selects it.
Oh, I see. Well, it's still relevant for tty windowport because it doesn't allow to pick items from different pages at all and arguably, it's even more important in tty (because if game is played in low-height terminal, say 80x24 - menu paging is much more harsher than in large terminal with curses, often reaching 3 pages).
Activity
entrez commentedon Jun 18, 2022
I'm not sure, because I don't have access to a Windows machine and I haven't dug into the code that carefully, but it looks like
onListChar(mhmenu.c)may contain an implicit assumption that all invlets will be alphabetical (which would mean '$' doesn't work as an invlet):NetHack/win/win32/mhmenu.c
Lines 1512 to 1514 in 304888c
There doesn't seem to be such an assumption for group accelerators, but it looks as though when a group accelerator is used in the MSWin windowport the count is ignored/reset (group accelerators accept counts in TTY afaik, but I guess not in this windowport):
NetHack/win/win32/mhmenu.c
Lines 1463 to 1469 in 304888c
The
reset_menu_countfunction that's called for a group accelerator zeroes outdata->menui.menu.counting:NetHack/win/win32/mhmenu.c
Lines 1605 to 1615 in 304888c
I think the combination of the two things causes the problem.
By the way, the use of '$' as a group accelerator in TTY allows you to select it even when it's offscreen (due to some special handling added in efea46a that allows the group accelerator to take precedence over the invlet), so the dual use of '$' isn't pointless. If NetHackW doesn't have paginated menus maybe that wouldn't provide any benefit, though. :)
pat-rankin commentedon Jun 18, 2022
For tty (also curses), menus are paginated. Regular selector characters
only work on the current page, but group accelerators ignore page
boundaries and affect the entire menu.
Treating $ as both the selector 'letter' for gold pieces and as the group
accelerator for coins was done so that gold can be chosen regardless
of what page you're looking at, like group picks of other object classes.
The development code has been changed for tty (also curses, not sure
offhand about any of the other interfaces) to honor a pending count
whenever any group accelerator matches a single item. I think that that
was done primarily to benefit '$'.
Maintenance for the Windows GUI interface is lagging and I don't think
it has had any updates--except for untested attempts to match some
changes that other interfaces have undergone--in quite a while.
ostrosablin commentedon Jun 18, 2022
@pat-rankin Maybe it's reasonable to allow selector characters to work from any page, too? (Perhaps, on opt-in basis via a new option?). In xNetHack, curses interface allows to select characters from any page and it's IMO a great idea, since with force_invmenu you may already remember the character you want, and if it's not on current page - you're forced to switch pages. This would also allow to get rid of $ as group accelerator.
entrez commentedon Jun 18, 2022
I'm pretty sure this is behavior from the curses windowport in vanilla NetHack too, not unique to xNetHack -- if you enter an invlet from a different page it scrolls over to that page and selects it.
ostrosablin commentedon Jun 18, 2022
Oh, I see. Well, it's still relevant for tty windowport because it doesn't allow to pick items from different pages at all and arguably, it's even more important in tty (because if game is played in low-height terminal, say 80x24 - menu paging is much more harsher than in large terminal with curses, often reaching 3 pages).
nhmall commentedon Jul 31, 2026
Does this give you the behaviour that you're seeking, @qazmlpok ?
Windows: group accelerator and menu item collision