view console/libgnt/gntkeys.c @ 14870:9f088b5844e3

[gaim-migrate @ 17639] Use the PACKAGE_NAME #define rather than hardcoding 'Gaim'. This should be no change for Gaim users, but means that compiling with a name of 'libgaim' reflects the user-agent properly, and that makes me a happy penguin. committer: Tailor Script <tailor@pidgin.im>
author Evan Schoenberg <evan.s@dreskin.net>
date Tue, 31 Oct 2006 20:47:51 +0000
parents ae4cbed1b309
children 70623f0d5cdc
line wrap: on
line source

#include "gntkeys.h"

#include <string.h>

void gnt_keys_refine(char *text)
{
	if (text[0] == 27)
	{
		/* These are for urxvt */
		if (strcmp(text + 1, "Oa") == 0)
		{
			strcpy(text + 1, GNT_KEY_CTRL_UP);
		}
		else if (strcmp(text + 1, "Ob") == 0)
		{
			strcpy(text + 1, GNT_KEY_CTRL_DOWN);
		}
	}
	else if ((unsigned char)text[0] == 195)
	{
		/* These for xterm */
		if (text[2] == 0)
		{
			text[0] = 27;
			text[1] -= 64;
		}
	}
}