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

Function Text_Handler

outdated/win/gem/wingem1.c:1840–1873  ·  view source on GitHub ↗
(xev)

Source from the content-addressed store, hash-verified

1838#define Text_Init KM_Init
1839
1840int
1841Text_Handler(xev)
1842XEVENT *xev;
1843{
1844 int ev = xev->ev_mwich;
1845
1846 if (ev & MU_MESAG) {
1847 int *buf = xev->ev_mmgpbuf, y_wo, i;
1848 if (*buf == FONT_CHANGED) {
1849 if (buf[3] >= 0) {
1850 mar_set_fontbyid(NHW_TEXT, buf[4], buf[5]);
1851 FontAck(buf[1], 1);
1852 }
1853 }
1854 }
1855 if (ev & MU_KEYBD) {
1856 char ch = (char) (xev->ev_mkreturn & 0x00FF);
1857
1858 if (!scroll_top_dialog(ch))
1859 switch (ch) {
1860 case '\033':
1861 send_return(); /* just closes the textwin */
1862 break;
1863 case C('c'):
1864 clipbrd_save(text_lines, Anz_text_lines,
1865 xev->ev_mmokstate & K_SHIFT, FALSE);
1866 break;
1867 default:
1868 ev &= ~MU_KEYBD; /* unknown key */
1869 break;
1870 }
1871 }
1872 return (ev);
1873}
1874
1875#define Inv_Init KM_Init
1876

Callers

nothing calls this directly

Calls 4

mar_set_fontbyidFunction · 0.85
scroll_top_dialogFunction · 0.85
send_returnFunction · 0.85
clipbrd_saveFunction · 0.85

Tested by

no test coverage detected