summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-05-15 14:50:40 (UTC)
committer llornkcor <llornkcor>2002-05-15 14:50:40 (UTC)
commit7658cbe0e8d0c7e86871d6e18506ff29eb594e4b (patch) (side-by-side diff)
tree599e1fa2d20d45ced8e1d04934b68ebafa436ec0
parent7977d9c5793100040b645974be1573572a550f62 (diff)
downloadopie-7658cbe0e8d0c7e86871d6e18506ff29eb594e4b.zip
opie-7658cbe0e8d0c7e86871d6e18506ff29eb594e4b.tar.gz
opie-7658cbe0e8d0c7e86871d6e18506ff29eb594e4b.tar.bz2
added fugly hack for sending ^ sequences for input methods.. thanks to Max and Gonz
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/TEmuVt102.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/core/apps/embeddedkonsole/TEmuVt102.cpp b/core/apps/embeddedkonsole/TEmuVt102.cpp
index 752c49f..275c18d 100644
--- a/core/apps/embeddedkonsole/TEmuVt102.cpp
+++ b/core/apps/embeddedkonsole/TEmuVt102.cpp
@@ -714,66 +714,95 @@ void TEmuVt102::onKeyPress( QKeyEvent* ev )
//printf("State/Key: 0x%04x 0x%04x (%d,%d)\n",ev->state(),ev->key(),ev->text().length(),ev->text().length()?ev->text().ascii()[0]:0);
// revert to non-history when typing
if (scr->getHistCursor() != scr->getHistLines());
scr->setHistCursor(scr->getHistLines());
// lookup in keyboard translation table ...
int cmd; const char* txt; int len;
if (keytrans->findEntry(ev->key(), encodeMode(MODE_NewLine , BITS_NewLine ) + // OLD,
encodeMode(MODE_Ansi , BITS_Ansi ) + // OBSOLETE,
encodeMode(MODE_AppCuKeys, BITS_AppCuKeys ) + // VT100 stuff
encodeStat(ControlButton , BITS_Control ) +
encodeStat(ShiftButton , BITS_Shift ) +
encodeStat(AltButton , BITS_Alt ),
&cmd, &txt, &len ))
//printf("cmd: %d, %s, %d\n",cmd,txt,len);
switch(cmd) // ... and execute if found.
{
case CMD_emitSelection : gui->emitSelection(); return;
case CMD_scrollPageUp : gui->doScroll(-gui->Lines()/2); return;
case CMD_scrollPageDown : gui->doScroll(+gui->Lines()/2); return;
case CMD_scrollLineUp : gui->doScroll(-1 ); return;
case CMD_scrollLineDown : gui->doScroll(+1 ); return;
case CMD_send : emit sndBlock(txt,len); return;
case CMD_prevSession : emit prevSession(); return;
case CMD_nextSession : emit nextSession(); return;
}
// fall back handling
if (!ev->text().isEmpty())
{
if (ev->state() & AltButton) sendString("\033"); // ESC, this is the ALT prefix
+ /// very hacky
+ if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='A')) sendString("\01");
+ else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='B')) sendString("\02");
+ else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='C')) sendString("\03");
+ else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='D')) sendString("\04");
+ else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='E')) sendString("\05");
+ else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='F')) sendString("\06");
+ else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='G')) sendString("\07");
+ else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='H')) sendString("\010");
+ else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='I')) sendString("\011");
+ else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='J')) sendString("\012");
+ else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='K')) sendString("\013");
+ else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='L')) sendString("\014");
+ else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='M')) sendString("\015");
+ else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='N')) sendString("\016");
+ else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='O')) sendString("\017");
+ else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='P')) sendString("\020");
+ else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='Q')) sendString("\021");
+ else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='R')) sendString("\022");
+ else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='S')) sendString("\023");
+ else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='T')) sendString("\024");
+ else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='U')) sendString("\025");
+ else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='V')) sendString("\026");
+ else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='W')) sendString("\027");
+ else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='X')) sendString("\030");
+ else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='Y')) sendString("\031");
+ else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='Z')) sendString("\032");
+ else {
QCString s = codec->fromUnicode(ev->text()); // encode for application
emit sndBlock(s.data(),s.length()); // we may well have s.length() > 1
+ }
return;
}
}
/* ------------------------------------------------------------------------- */
/* */
/* VT100 Charsets */
/* */
/* ------------------------------------------------------------------------- */
// Character Set Conversion ------------------------------------------------ --
/*
The processing contains a VT100 specific code translation layer.
It's still in use and mainly responsible for the line drawing graphics.
These and some other glyphs are assigned to codes (0x5f-0xfe)
normally occupied by the latin letters. Since this codes also
appear within control sequences, the extra code conversion
does not permute with the tokenizer and is placed behind it
in the pipeline. It only applies to tokens, which represent
plain characters.
This conversion it eventually continued in TEWidget.C, since
it might involve VT100 enhanced fonts, which have these
particular glyphs allocated in (0x00-0x1f) in their code page.
*/
#define CHARSET charset[scr==screen[1]]
// Apply current character map.