| 1821 | #endif |
| 1822 | |
| 1823 | bool 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 | |
| 1849 | string keycode_to_name(int keycode, bool shorten) |
| 1850 | { |
no outgoing calls
no test coverage detected