summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-04-28 15:08:04 (UTC)
committer llornkcor <llornkcor>2002-04-28 15:08:04 (UTC)
commitd9a38221ea876cae8ef8b015968e14af75e202bb (patch) (unidiff)
tree624d057fa2ee702140aee1ef061713af878d92b1
parentc55ffe32ced1ecbac991ca2e85c6993cf8a04ee0 (diff)
downloadopie-d9a38221ea876cae8ef8b015968e14af75e202bb.zip
opie-d9a38221ea876cae8ef8b015968e14af75e202bb.tar.gz
opie-d9a38221ea876cae8ef8b015968e14af75e202bb.tar.bz2
harcoded Shift & Key_Tab to emit a '\' character
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/TEWidget.cpp8
-rw-r--r--core/apps/embeddedkonsole/konsole.cpp3
2 files changed, 8 insertions, 3 deletions
diff --git a/core/apps/embeddedkonsole/TEWidget.cpp b/core/apps/embeddedkonsole/TEWidget.cpp
index dab0ea3..350ab3a 100644
--- a/core/apps/embeddedkonsole/TEWidget.cpp
+++ b/core/apps/embeddedkonsole/TEWidget.cpp
@@ -981,25 +981,25 @@ bool TEWidget::eventFilter( QObject *obj, QEvent *e )
981 return true; 981 return true;
982 } 982 }
983 if ( obj != this /* when embedded */ && obj != parent() /* when standalone */ ) 983 if ( obj != this /* when embedded */ && obj != parent() /* when standalone */ )
984 return FALSE; // not us 984 return FALSE; // not us
985 if ( e->type() == QEvent::Wheel) 985 if ( e->type() == QEvent::Wheel)
986 { 986 {
987 QApplication::sendEvent(scrollbar, e); 987 QApplication::sendEvent(scrollbar, e);
988 } 988 }
989 989
990#ifdef FAKE_CTRL_AND_ALT 990#ifdef FAKE_CTRL_AND_ALT
991 static bool control = FALSE; 991 static bool control = FALSE;
992 static bool alt = FALSE; 992 static bool alt = FALSE;
993 // Has a keyboard with no CTRL and ALT keys, but we fake it: 993 qDebug(" Has a keyboard with no CTRL and ALT keys, but we fake it:");
994 bool dele=FALSE; 994 bool dele=FALSE;
995 if ( e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease ) { 995 if ( e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease ) {
996 QKeyEvent* ke = (QKeyEvent*)e; 996 QKeyEvent* ke = (QKeyEvent*)e;
997 bool keydown = e->type() == QEvent::KeyPress || ke->isAutoRepeat(); 997 bool keydown = e->type() == QEvent::KeyPress || ke->isAutoRepeat();
998 switch (ke->key()) { 998 switch (ke->key()) {
999 case Key_F9: // let this be "Control" 999 case Key_F9: // let this be "Control"
1000 control = keydown; 1000 control = keydown;
1001 e = new QKeyEvent(QEvent::KeyPress, Key_Control, 0, ke->state()); 1001 e = new QKeyEvent(QEvent::KeyPress, Key_Control, 0, ke->state());
1002 dele=TRUE; 1002 dele=TRUE;
1003 break; 1003 break;
1004 case Key_F13: // let this be "Alt" 1004 case Key_F13: // let this be "Alt"
1005 alt = keydown; 1005 alt = keydown;
@@ -1018,28 +1018,32 @@ bool TEWidget::eventFilter( QObject *obj, QEvent *e )
1018 if ( alt ) { 1018 if ( alt ) {
1019 e = new QKeyEvent(e->type(), ke->key(), 1019 e = new QKeyEvent(e->type(), ke->key(),
1020 ke->ascii(), ke->state()|AltButton, ke->text()); 1020 ke->ascii(), ke->state()|AltButton, ke->text());
1021 dele=TRUE; 1021 dele=TRUE;
1022 } 1022 }
1023 } 1023 }
1024 } 1024 }
1025#endif 1025#endif
1026 1026
1027 if ( e->type() == QEvent::KeyPress ) 1027 if ( e->type() == QEvent::KeyPress )
1028 { 1028 {
1029 QKeyEvent* ke = (QKeyEvent*)e; 1029 QKeyEvent* ke = (QKeyEvent*)e;
1030
1031 actSel=0; // Key stroke implies a screen update, so TEWidget won't 1030 actSel=0; // Key stroke implies a screen update, so TEWidget won't
1032 // know where the current selection is. 1031 // know where the current selection is.
1033 1032
1033// qDebug("key pressed is 0x%x",ke->key());
1034 if( ke->state() == ShiftButton && ke->key() == Key_Tab) { //lets hardcode this sucker
1035// qDebug("key pressed 2 is 0x%x",ke->key());
1036 emitText("\\"); // expose
1037 } else
1034 emit keyPressedSignal(ke); // expose 1038 emit keyPressedSignal(ke); // expose
1035 ke->accept(); 1039 ke->accept();
1036#ifdef FAKE_CTRL_AND_ALT 1040#ifdef FAKE_CTRL_AND_ALT
1037 if ( dele ) delete e; 1041 if ( dele ) delete e;
1038#endif 1042#endif
1039 return true; // stop the event 1043 return true; // stop the event
1040 } 1044 }
1041 if ( e->type() == QEvent::Enter ) 1045 if ( e->type() == QEvent::Enter )
1042 { 1046 {
1043 QObject::disconnect( (QObject*)cb, SIGNAL(dataChanged()), 1047 QObject::disconnect( (QObject*)cb, SIGNAL(dataChanged()),
1044 this, SLOT(onClearSelection()) ); 1048 this, SLOT(onClearSelection()) );
1045 } 1049 }
diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp
index f13d0c9..adcfb7f 100644
--- a/core/apps/embeddedkonsole/konsole.cpp
+++ b/core/apps/embeddedkonsole/konsole.cpp
@@ -159,25 +159,26 @@ static const char *commonCmds[] =
159 "netstat", 159 "netstat",
160*/ 160*/
161 161
162 "exit", 162 "exit",
163 NULL 163 NULL
164}; 164};
165 165
166 166
167Konsole::Konsole(QWidget* parent, const char* name, WFlags fl) : 167Konsole::Konsole(QWidget* parent, const char* name, WFlags fl) :
168 QMainWindow(parent, name, fl) 168 QMainWindow(parent, name, fl)
169{ 169{
170 QStrList args; 170 QStrList args;
171 init("/bin/sh",args); 171 init("/bin/ash",args);
172// init("/bin/sh",args);
172} 173}
173 174
174Konsole::Konsole(const char* name, const char* _pgm, QStrList & _args, int) 175Konsole::Konsole(const char* name, const char* _pgm, QStrList & _args, int)
175 : QMainWindow(0, name) 176 : QMainWindow(0, name)
176{ 177{
177 init(_pgm,_args); 178 init(_pgm,_args);
178} 179}
179 180
180void Konsole::initCommandList() 181void Konsole::initCommandList()
181{ 182{
182// qDebug("Konsole::initCommandList"); 183// qDebug("Konsole::initCommandList");
183 Config cfg("Konsole"); 184 Config cfg("Konsole");