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