git-svn-id: svn://db.shs.com.ru/pip@545 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -176,9 +176,11 @@ public:
|
|||||||
ir[j].EventType = KEY_EVENT;
|
ir[j].EventType = KEY_EVENT;
|
||||||
ir[j].Event.KeyEvent.wRepeatCount = 1;
|
ir[j].Event.KeyEvent.wRepeatCount = 1;
|
||||||
ir[j].Event.KeyEvent.dwControlKeyState = KeyModifiers2ControlKeyState(k.modifiers);
|
ir[j].Event.KeyEvent.dwControlKeyState = KeyModifiers2ControlKeyState(k.modifiers);
|
||||||
if (PITerminal::isSpecialKey(k.key))
|
if (PITerminal::isSpecialKey(k.key)) {
|
||||||
ir[j].Event.KeyEvent.wVirtualKeyCode = SpecialKey2VirtualKeyCode((PIKbdListener::SpecialKey)k.key);
|
ir[j].Event.KeyEvent.wVirtualKeyCode = SpecialKey2VirtualKeyCode((PIKbdListener::SpecialKey)k.key);
|
||||||
ir[j].Event.KeyEvent.uChar.AsciiChar = PIChar(piMaxi(k.key, 0)).toConcole1Byte();
|
ir[j].Event.KeyEvent.uChar.AsciiChar = PIChar(piMaxi(k.key, 0)).toAscii();
|
||||||
|
} else
|
||||||
|
ir[j].Event.KeyEvent.uChar.UnicodeChar = PIChar(piMaxi(k.key, 0)).toWChar();
|
||||||
//piCout << ir[j].Event.KeyEvent.wVirtualKeyCode << int(ir[j].Event.KeyEvent.uChar.AsciiChar);
|
//piCout << ir[j].Event.KeyEvent.wVirtualKeyCode << int(ir[j].Event.KeyEvent.uChar.AsciiChar);
|
||||||
ir[j].Event.KeyEvent.bKeyDown = true;
|
ir[j].Event.KeyEvent.bKeyDown = true;
|
||||||
ir[z] = ir[j];
|
ir[z] = ir[j];
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ void PIScreen::SystemConsole::print() {
|
|||||||
int k = j * dw + i;
|
int k = j * dw + i;
|
||||||
Cell & c(cells[j + dy0][i + dx0]);
|
Cell & c(cells[j + dy0][i + dx0]);
|
||||||
PRIVATE->chars[k].Char.UnicodeChar = 0;
|
PRIVATE->chars[k].Char.UnicodeChar = 0;
|
||||||
PRIVATE->chars[k].Char.AsciiChar = c.symbol.toConcole1Byte();
|
PRIVATE->chars[k].Char.AsciiChar = c.symbol.toConsole1Byte();
|
||||||
//PRIVATE->chars[k].Char.UnicodeChar = c.symbol.toInt();
|
//PRIVATE->chars[k].Char.UnicodeChar = c.symbol.toInt();
|
||||||
PRIVATE->chars[k].Attributes = attributes(c);
|
PRIVATE->chars[k].Attributes = attributes(c);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -228,7 +228,7 @@ void PITerminal::write(PIKbdListener::KeyEvent ke) {
|
|||||||
else {
|
else {
|
||||||
PIByteArray ba;
|
PIByteArray ba;
|
||||||
#ifdef WINDOWS
|
#ifdef WINDOWS
|
||||||
ba << uchar(PIChar(ke.key).toConcole1Byte());
|
ba << uchar(PIChar(ke.key).toConsole1Byte());
|
||||||
#else
|
#else
|
||||||
ba = PIString(PIChar(ke.key)).toUTF8();
|
ba = PIString(PIChar(ke.key)).toUTF8();
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -235,7 +235,7 @@ wchar_t PIChar::toWChar() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
char PIChar::toConcole1Byte() const {
|
char PIChar::toConsole1Byte() const {
|
||||||
if (ch < 0x80) return ch;
|
if (ch < 0x80) return ch;
|
||||||
#ifdef PIP_ICU
|
#ifdef PIP_ICU
|
||||||
UErrorCode e((UErrorCode)0);
|
UErrorCode e((UErrorCode)0);
|
||||||
@@ -252,6 +252,23 @@ char PIChar::toConcole1Byte() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
char PIChar::toSystem() const {
|
||||||
|
if (ch < 0x80) return ch;
|
||||||
|
#ifdef PIP_ICU
|
||||||
|
UErrorCode e((UErrorCode)0);
|
||||||
|
UConverter * cc = ucnv_open(__syslocname__, &e);
|
||||||
|
if (cc) {
|
||||||
|
char uc[8];
|
||||||
|
e = (UErrorCode)0;
|
||||||
|
ucnv_fromUChars(cc, uc, 8, (const UChar*)(&ch), 1, &e);
|
||||||
|
ucnv_close(cc);
|
||||||
|
return uc[0];
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return toAscii();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
PIChar PIChar::toUpper() const {
|
PIChar PIChar::toUpper() const {
|
||||||
#ifdef PIP_ICU
|
#ifdef PIP_ICU
|
||||||
UChar c(0);
|
UChar c(0);
|
||||||
|
|||||||
@@ -139,7 +139,8 @@ public:
|
|||||||
|
|
||||||
wchar_t toWChar() const;
|
wchar_t toWChar() const;
|
||||||
char toAscii() const {return ch % 256;}
|
char toAscii() const {return ch % 256;}
|
||||||
char toConcole1Byte() const;
|
char toConsole1Byte() const;
|
||||||
|
char toSystem() const;
|
||||||
ushort unicode16Code() const {return ch;}
|
ushort unicode16Code() const {return ch;}
|
||||||
|
|
||||||
//! Return symbol in upper case
|
//! Return symbol in upper case
|
||||||
|
|||||||
Reference in New Issue
Block a user