summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-05-15 14:50:40 (UTC)
committer llornkcor <llornkcor>2002-05-15 14:50:40 (UTC)
commit7658cbe0e8d0c7e86871d6e18506ff29eb594e4b (patch) (unidiff)
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) (ignore whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/TEmuVt102.cpp41
1 files changed, 35 insertions, 6 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
@@ -1,28 +1,28 @@
1/* ------------------------------------------------------------------------- */ 1/* ------------------------------------------------------------------------- */
2/* */ 2/* */
3/* [TEmuVt102.C] VT102 Terminal Emulation */ 3/* [TEmuVt102.C] VT102 Terminal Emulation */
4/* */ 4/* */
5/* ------------------------------------------------------------------------- */ 5/* ------------------------------------------------------------------------- */
6/* */ 6/* */
7/* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> */ 7/* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> */
8/* */ 8/* */
9/* This file is part of Konsole - an X terminal for KDE */ 9/* This file is part of Konsole - an X terminal for KDE */
10/* */ 10/* */
11/* ------------------------------------------------------------------------- */ 11/* ------------------------------------------------------------------------- */
12 /* */ 12/* */
13/* Ported Konsole to Qt/Embedded */ 13/* Ported Konsole to Qt/Embedded */
14 /* */ 14/* */
15/* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */ 15/* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */
16 /* */ 16/* */
17/* -------------------------------------------------------------------------- */ 17/* -------------------------------------------------------------------------- */
18 18
19/*! \class TEmuVt102 19/*! \class TEmuVt102
20 20
21 \brief Actual Emulation for Konsole 21 \brief Actual Emulation for Konsole
22 22
23 \sa TEWidget \sa TEScreen 23 \sa TEWidget \sa TEScreen
24*/ 24*/
25 25
26#include "TEmuVt102.h" 26#include "TEmuVt102.h"
27#include "TEWidget.h" 27#include "TEWidget.h"
28#include "TEScreen.h" 28#include "TEScreen.h"
@@ -734,26 +734,55 @@ void TEmuVt102::onKeyPress( QKeyEvent* ev )
734 case CMD_scrollPageDown : gui->doScroll(+gui->Lines()/2); return; 734 case CMD_scrollPageDown : gui->doScroll(+gui->Lines()/2); return;
735 case CMD_scrollLineUp : gui->doScroll(-1 ); return; 735 case CMD_scrollLineUp : gui->doScroll(-1 ); return;
736 case CMD_scrollLineDown : gui->doScroll(+1 ); return; 736 case CMD_scrollLineDown : gui->doScroll(+1 ); return;
737 case CMD_send : emit sndBlock(txt,len); return; 737 case CMD_send : emit sndBlock(txt,len); return;
738 case CMD_prevSession : emit prevSession(); return; 738 case CMD_prevSession : emit prevSession(); return;
739 case CMD_nextSession : emit nextSession(); return; 739 case CMD_nextSession : emit nextSession(); return;
740 } 740 }
741 741
742 // fall back handling 742 // fall back handling
743 if (!ev->text().isEmpty()) 743 if (!ev->text().isEmpty())
744 { 744 {
745 if (ev->state() & AltButton) sendString("\033"); // ESC, this is the ALT prefix 745 if (ev->state() & AltButton) sendString("\033"); // ESC, this is the ALT prefix
746 QCString s = codec->fromUnicode(ev->text()); // encode for application 746 /// very hacky
747 emit sndBlock(s.data(),s.length()); // we may well have s.length() > 1 747 if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='A')) sendString("\01");
748 else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='B')) sendString("\02");
749 else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='C')) sendString("\03");
750 else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='D')) sendString("\04");
751 else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='E')) sendString("\05");
752 else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='F')) sendString("\06");
753 else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='G')) sendString("\07");
754 else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='H')) sendString("\010");
755 else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='I')) sendString("\011");
756 else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='J')) sendString("\012");
757 else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='K')) sendString("\013");
758 else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='L')) sendString("\014");
759 else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='M')) sendString("\015");
760 else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='N')) sendString("\016");
761 else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='O')) sendString("\017");
762 else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='P')) sendString("\020");
763 else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='Q')) sendString("\021");
764 else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='R')) sendString("\022");
765 else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='S')) sendString("\023");
766 else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='T')) sendString("\024");
767 else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='U')) sendString("\025");
768 else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='V')) sendString("\026");
769 else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='W')) sendString("\027");
770 else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='X')) sendString("\030");
771 else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='Y')) sendString("\031");
772 else if ((ev->state() & ControlButton) && (ev->text().upper().ascii()[0]=='Z')) sendString("\032");
773 else {
774 QCString s = codec->fromUnicode(ev->text()); // encode for application
775 emit sndBlock(s.data(),s.length()); // we may well have s.length() > 1
776 }
748 return; 777 return;
749 } 778 }
750} 779}
751 780
752/* ------------------------------------------------------------------------- */ 781/* ------------------------------------------------------------------------- */
753/* */ 782/* */
754/* VT100 Charsets */ 783/* VT100 Charsets */
755/* */ 784/* */
756/* ------------------------------------------------------------------------- */ 785/* ------------------------------------------------------------------------- */
757 786
758// Character Set Conversion ------------------------------------------------ -- 787// Character Set Conversion ------------------------------------------------ --
759 788
@@ -882,25 +911,25 @@ void TEmuVt102::resetModes()
882} 911}
883 912
884void TEmuVt102::setMode(int m) 913void TEmuVt102::setMode(int m)
885{ 914{
886 currParm.mode[m] = TRUE; 915 currParm.mode[m] = TRUE;
887 switch (m) 916 switch (m)
888 { 917 {
889 case MODE_Mouse1000 : gui->setMouseMarks(FALSE); 918 case MODE_Mouse1000 : gui->setMouseMarks(FALSE);
890 break; 919 break;
891 case MODE_AppScreen : screen[1]->clearSelection(); 920 case MODE_AppScreen : screen[1]->clearSelection();
892 screen[1]->clearEntireScreen(); 921 screen[1]->clearEntireScreen();
893 setScreen(1); 922 setScreen(1);
894 break; 923 break;
895 } 924 }
896 if (m < MODES_SCREEN || m == MODE_NewLine) 925 if (m < MODES_SCREEN || m == MODE_NewLine)
897 { 926 {
898 screen[0]->setMode(m); 927 screen[0]->setMode(m);
899 screen[1]->setMode(m); 928 screen[1]->setMode(m);
900 } 929 }
901} 930}
902 931
903void TEmuVt102::resetMode(int m) 932void TEmuVt102::resetMode(int m)
904{ 933{
905 currParm.mode[m] = FALSE; 934 currParm.mode[m] = FALSE;
906 switch (m) 935 switch (m)