title: How do you insert a mnemonic into an ncurses menu item?
body: <p>I want to develop some <em>ncurses</em> menus that, to avoid operator fatigue, makes use of mnemonics. A mock-up of one of the menus I propose is shown in the following picture.</p>
  <p><a href="https://i.stack.imgur.com/t1xn4.jpg" rel="nofollow noreferrer">menuMock-up</a></p>
  <p>In the mock-up, the mnemonics are c, l, d, h, i, y, v, f, r and x. An operator would select a menu item by either pressing navigation keys and then Enter or by simply pressing a key corresponding to a mnemonic.</p>
  <p>There are many code examples available that show me how I could write code to realise this menu. But none of those examples show how to insert a mnemonic into a menu item.</p>
  <p>Presumably the mnemonic would be an ordinary character to which is added a video attribute. In an mvprintw statement you can do that with, for example, <code>waddch(win_body, 'l' | A_BOLD)</code>. However, in the menu code examples I've been using, you have to define menu items using an array, which for my menu would look like:</p>
  <pre><code>char *choices[] = {
      &quot;Change aerial heights, k and frequency&quot;,
      &quot;Change polarization&quot;,
      &quot;Change aerial directivities&quot;,
      &quot;Plot height run graph&quot;,
      &quot;Plot refractive index graph&quot;,
      &quot;Reflection point analysis&quot;,
      &quot;Review data&quot;,
      &quot;Copy data to file&quot;,
      &quot;Restart&quot;,
      &quot;Exit&quot;,
                    };
  </code></pre>
  <p>How would you have the ncurses menu library identify the mnemonics and format them?</p>
  <p>[Midnight Commander uses menus containing mnemonics but that software seems to rely on S-Lang. In the hope that somebody had already figured out how to have ncurses do mnemonics, I read Charles Dickie’s “S-Lang library and its relationship [with] ncurses” (https://invisible-island.net/ncurses/ncurses-slang.html). Although I found that discussion wryly informative, it did not reveal the answer to my problem.]</p>