⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 第十一章:键盘管理——如何读取功能键和方向键等等.htm

📁 curses界面编程
💻 HTM
📖 第 1 页 / 共 3 页
字号:
style='font-family:Tahoma'><span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>noecho();<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>cbreak();<spanstyle='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp; </span>/*</span></b><bstyle='mso-bidi-font-weight:normal'><span style='font-family:宋体;mso-ascii-font-family:Tahoma;mso-hansi-font-family:"Times New Roman";mso-bidi-font-family:Tahoma'>禁用行缓冲,传递所有输入</span></b><bstyle='mso-bidi-font-weight:normal'><span lang=EN-US style='font-family:Tahoma'>*/<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>startx= (80 - WIDTH) / 2;<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>starty= (24 - HEIGHT) / 2;<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:2'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>menu_win= newwin(HEIGHT, WIDTH, starty, startx);<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>keypad(menu_win,TRUE);<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>mvprintw(0,0,&quot;</span></b><span lang=EN-US style='font-family:Tahoma'>Use arrow keysto go up and down, Press enter to select a choice<b style='mso-bidi-font-weight:normal'>&quot;);<o:p></o:p></b></span></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>refresh();<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>print_menu(menu_win,highlight);<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>while(1)<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{<spanstyle='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp; </span>c = wgetch(menu_win);<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:2'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>switch(c)<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:2'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{<spanstyle='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp; </span>case KEY_UP:<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:3'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>if(highlight== 1)<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:5'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>highlight= n_choices;<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:4'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>else<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:5'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>--highlight;<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:4'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>break;<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:3'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>caseKEY_DOWN:<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:4'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>if(highlight== n_choices)<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:5'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>highlight= 1;<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:4'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>else<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:5'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>++highlight;<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:4'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>break;<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:3'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>case10:<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:4'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>choice= highlight;<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:4'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>break;<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:3'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>default:<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:3'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>mvprintw(24,0, &quot;</span></b><span lang=EN-US style='font-family:Tahoma'>Charcterpressed is = %3d Hopefully it can be printed as '%c<b style='mso-bidi-font-weight:normal'>'&quot;, c, c);<o:p></o:p></b></span></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:4'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>refresh();<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:4'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>break;<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:2'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:2'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>print_menu(menu_win,highlight);<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:2'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>if(choice!= 0)<span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp; </span>/*</span></b><bstyle='mso-bidi-font-weight:normal'><span style='font-family:宋体;mso-ascii-font-family:Tahoma;mso-hansi-font-family:"Times New Roman";mso-bidi-font-family:Tahoma'>用户必须要做一个选择</span></b><bstyle='mso-bidi-font-weight:normal'><span lang=EN-US style='font-family:Tahoma'>*/<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:3'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>break;<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<spanstyle='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp; </span><o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>mvprintw(23,0, &quot;You chose choice %d with choice string %s\n&quot;, choice,choices[choice - 1]);<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>clrtoeol();<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>refresh();<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>endwin();<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>return0;<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'>}<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'>void print_menu(WINDOW *menu_win, int highlight)<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'>{<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>intx, y, i;<span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>x= 2;<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>y= 2;<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>box(menu_win,0, 0);<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>for(i= 0; i &lt; n_choices; ++i)<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{<spanstyle='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp; </span>if(highlight == i + 1)/*</span></b><span style='font-family:宋体;mso-ascii-font-family:Tahoma;mso-hansi-font-family:Tahoma;mso-bidi-font-family:Tahoma'>使选择的字符串高亮</span><bstyle='mso-bidi-font-weight:normal'><span lang=EN-US style='font-family:Tahoma'>*/<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:2'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{<spanstyle='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp; </span>wattron(menu_win,A_REVERSE); <o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:3'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>mvwprintw(menu_win,y, x, &quot;</span></b><span lang=EN-US style='font-family:Tahoma'>%s<bstyle='mso-bidi-font-weight:normal'>&quot;, choices[i]);<o:p></o:p></b></span></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:3'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>wattroff(menu_win,A_REVERSE);<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:2'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:2'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>else<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:3'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>mvwprintw(menu_win,y, x, &quot;%s&quot;, choices[i]);<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:2'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>++y;<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'><span style='mso-tab-count:1'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>wrefresh(menu_win);<o:p></o:p></span></b></p><p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=EN-USstyle='font-family:Tahoma'>}<o:p></o:p></span></b></p></div></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -