+ move(SLK_WORK, 0);
+ clrtobot();
+ break;
+
+ case 'x':
+ case 'q':
+ goto done;
+
+#if HAVE_SLK_COLOR
+ case 'F':
+ if (has_colors()) {
+ fg = (fg + 1) % max_colors;
+ new_color = TRUE;
+ }
+ break;
+ case 'B':
+ if (has_colors()) {
+ bg = (bg + 1) % max_colors;
+ new_color = TRUE;
+ }
+ break;
+#endif
+
+ default:
+ beep();
+ }
+ } while
+ ((c = Getchar()) != EOF);
+
+ done:
+ erase();
+ endwin();
+}
+
+#if USE_WIDEC_SUPPORT
+static void
+wide_slk_test(void)
+/* exercise the soft keys */
+{
+ int c, fmt = 1;
+ wchar_t buf[9];
+ char *s;
+ short fg = COLOR_BLACK;
+ short bg = COLOR_WHITE;
+ bool new_color = FALSE;
+
+ c = CTRL('l');
+ if (has_colors()) {
+ new_color = TRUE;
+ }
+ do {
+ if (new_color) {
+ init_pair(1, bg, fg);
+ slk_color(1);
+ new_color = FALSE;
+ mvprintw(SLK_WORK, 0, "Colors %d/%d\n", fg, bg);
+ refresh();
+ }
+ move(0, 0);
+ switch (c) {
+ case CTRL('l'):
+ erase();
+ attr_on(WA_BOLD, NULL);
+ mvaddstr(0, 20, "Soft Key Exerciser");
+ attr_off(WA_BOLD, NULL);
+
+ slk_help();
+ /* fall through */
+
+ case 'a':
+ slk_restore();
+ break;
+
+ case 'e':
+ wclear(stdscr);
+ break;
+
+ case 's':
+ mvprintw(SLK_WORK, 0, "Press Q to stop the scrolling-test: ");
+ while ((c = Getchar()) != 'Q' && (c != ERR))
+ addch((chtype) c);
+ break;
+
+ case 'd':
+ slk_clear();
+ break;
+
+ case 'l':
+ fmt = 0;
+ break;
+
+ case 'c':
+ fmt = 1;
+ break;
+
+ case 'r':
+ fmt = 2;
+ break;
+
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ (void) mvaddstr(SLK_WORK, 0, "Please enter the label value: ");
+ *buf = 0;
+ if ((s = slk_label(c - '0')) != 0) {
+ int j;
+ for (j = 0; j < 8; ++j) {
+ if ((buf[j] = UChar(s[j])) == 0)
+ break;
+ }
+ buf[j] = 0;
+ }
+ wGet_wstring(stdscr, buf, 8);
+ slk_wset((c - '0'), buf, fmt);
+ slk_refresh();
+ move(SLK_WORK, 0);
+ clrtobot();