-removing ctrl M garbage
This commit is contained in:
wagic.the.homebrew@gmail.com
2010-02-28 08:05:47 +00:00
parent d3d34c6290
commit db8724e045

View File

@@ -29,7 +29,7 @@ const KeyRep& translateKey(LocalKeySym key) {
}
#else
#ifdef WIN32
const KeyRep& translateKey(LocalKeySym key) {
{
@@ -37,30 +37,30 @@ const KeyRep& translateKey(LocalKeySym key) {
if ((res = fattable.find(key)) != fattable.end())
return (res->second);
}
unsigned int sc = MapVirtualKey(key, 0);
unsigned int sc = MapVirtualKey(key, 0);
switch (key)
{
case VK_LEFT: case VK_UP: case VK_RIGHT: case VK_DOWN: // arrow keys
case VK_PRIOR: case VK_NEXT: // page up and page down
case VK_END: case VK_HOME:
case VK_INSERT: case VK_DELETE:
case VK_DIVIDE: // numpad slash
case VK_NUMLOCK:
{
sc |= 0x100; // set extended bit
break;
}
}
switch (key)
{
case VK_LEFT: case VK_UP: case VK_RIGHT: case VK_DOWN: // arrow keys
case VK_PRIOR: case VK_NEXT: // page up and page down
case VK_END: case VK_HOME:
case VK_INSERT: case VK_DELETE:
case VK_DIVIDE: // numpad slash
case VK_NUMLOCK:
{
sc |= 0x100; // set extended bit
break;
}
}
char buf[256];
memset(buf, 0, 256);
string s;
// Convert to ANSI string
if (GetKeyNameTextA(sc << 16, buf, 256) > 0)
s = buf;
char buf[256];
memset(buf, 0, 256);
string s;
// Convert to ANSI string
if (GetKeyNameTextA(sc << 16, buf, 256) > 0)
s = buf;
KeyRep k;
if (0 == s.length()) {