=================== Key_KeynumToString Returns a string (either a single ascii char, a K_* name, or a 0x11 hex string) for the given keynum. =================== */ Returns a console/config file friendly name for the key
| 902 | */ |
| 903 | // Returns a console/config file friendly name for the key |
| 904 | const char *Key_KeynumToString( int keynum ) { |
| 905 | const char *name; |
| 906 | |
| 907 | name = Key_KeynumValid( keynum ); |
| 908 | |
| 909 | // Check for friendly name |
| 910 | if ( !name ) |
| 911 | name = Key_KeyToName( keynum ); |
| 912 | |
| 913 | // check for printable ascii |
| 914 | if ( !name && keynum > 0 && keynum < 256) |
| 915 | name = Key_KeyToAscii( keynum ); |
| 916 | |
| 917 | // Fallback to hex number |
| 918 | if ( !name ) |
| 919 | name = Key_KeyToHex( keynum ); |
| 920 | |
| 921 | return name; |
| 922 | } |
| 923 | |
| 924 | /* |
| 925 | =================== |
no test coverage detected