/* Checks and converts a special key code into ANSI 3.64 escape sequence. */
static int input_keycode_to_ansi364(struct input_config *config, int keycode, char output_ch[], int max_chars)
/* Checks and converts a special key code into ANSI 3.64 escape sequence. */
static int input_keycode_to_ansi364(struct input_config *config, int keycode, char output_ch[], int max_chars)
{
	const char *escape;
	int ch_count;
	int i;
	for (i = ch_count = 0; i < ARRAY_SIZE(kbd_to_ansi364); i++) {
		if (keycode != kbd_to_ansi364[i].kbd_scan_code)
			continue;
		for (escape = kbd_to_ansi364[i].escape; *escape; escape++) {
			if (ch_count < max_chars)
				output_ch[ch_count] = *escape;
			ch_count++;
		}
		return ch_count;
	}
	return 0;
}