MCPcopy Create free account
hub / github.com/NetHack/NetHack / mswin_direct_command

Function mswin_direct_command

outdated/sys/wince/mhmain.c:1134–1151  ·  view source on GitHub ↗

SmartPhone: display dialog to type arbitrary command text */

Source from the content-addressed store, hash-verified

1132
1133/* SmartPhone: display dialog to type arbitrary command text */
1134void
1135mswin_direct_command()
1136{
1137 char cmd[BUFSZ];
1138 ZeroMemory(cmd, sizeof(cmd));
1139 mswin_getlin("Type cmd text", cmd);
1140 if (cmd[0]) {
1141 /* feed command to nethack */
1142 char *p = cmd;
1143 cmd[32] = '\x0'; /* truncate at 32 chars */
1144 while (*p) {
1145 NHEVENT_KBD(*p);
1146 p++;
1147 }
1148 if (cmd[0] != '\033')
1149 mswin_putstr(WIN_MESSAGE, ATR_NONE, cmd);
1150 }
1151}

Callers 1

onWMCommandFunction · 0.85

Calls 2

mswin_getlinFunction · 0.70
mswin_putstrFunction · 0.70

Tested by

no test coverage detected