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

Function gnome_nhgetch

outdated/win/gnome/gnbind.c:898–921  ·  view source on GitHub ↗

int nhgetch() -- Returns a single character input from the user. -- In the tty window-port, nhgetch() assumes that tgetch() will be the routine the OS provides to read a character. Returned character _must_ be non-zero. */

Source from the content-addressed store, hash-verified

896 Returned character _must_ be non-zero.
897*/
898int
899gnome_nhgetch()
900{
901 int key;
902 GList *theFirst;
903 gtk_signal_emit(GTK_OBJECT(gnome_windowlist[WIN_STATUS].win),
904 ghack_signals[GHSIG_FADE_HIGHLIGHT]);
905
906 g_askingQuestion = 1;
907 /* Process events until a key press event arrives. */
908 while (g_numKeys == 0) {
909 if (program_state.done_hup)
910 return '\033';
911 gtk_main_iteration();
912 }
913
914 theFirst = g_list_first(g_keyBuffer);
915 g_keyBuffer = g_list_remove_link(g_keyBuffer, theFirst);
916 key = GPOINTER_TO_INT(theFirst->data);
917 g_list_free_1(theFirst);
918 g_numKeys--;
919 g_askingQuestion = 0;
920 return (key);
921}
922
923/*
924int nh_poskey(int *x, int *y, int *mod)

Callers 2

gnome_display_nhwindowFunction · 0.85
gnome_yn_functionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected