MCPcopy Create free account
hub / github.com/crawl/crawl / keycode_is_printable

Function keycode_is_printable

crawl-ref/source/macro.cc:1823–1847  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1821#endif
1822
1823bool keycode_is_printable(int keycode)
1824{
1825 switch (keycode)
1826 {
1827 case 0:
1828 case 8:
1829 case 9:
1830 case 27:
1831 case '\n':
1832 case '\r':
1833 return false;
1834 default:
1835#ifdef USE_TILE_LOCAL
1836 // the upper bound here is based on a comment in
1837 // windowmanager-sdl.cc:_translate_keysym. It could potentially be
1838 // applied more generally but I'm concerned about non-US keyboard
1839 // layouts etc. I'm also not sure how accurate it is for sdl...
1840 return keycode >= 32 && keycode < 256;
1841#elif defined(USE_TILE_WEB)
1842 return keycode >= 32 && keycode < 128;
1843#else
1844 return keycode >= 32;
1845#endif
1846 }
1847}
1848
1849string keycode_to_name(int keycode, bool shorten)
1850{

Callers 3

_keyseq_descFunction · 0.85
clear_mappingMethod · 0.85
keycode_to_nameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected