summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-04-28 15:08:04 (UTC)
committer llornkcor <llornkcor>2002-04-28 15:08:04 (UTC)
commitd9a38221ea876cae8ef8b015968e14af75e202bb (patch) (side-by-side diff)
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
@@ -969,89 +969,93 @@ void TEWidget::onClearSelection()
void TEWidget::doScroll(int lines)
{
scrollbar->setValue(scrollbar->value()+lines);
}
bool TEWidget::eventFilter( QObject *obj, QEvent *e )
{
if ( (e->type() == QEvent::Accel ||
e->type() == QEvent::AccelAvailable ) && qApp->focusWidget() == this )
{
static_cast<QKeyEvent *>( e )->ignore();
return true;
}
if ( obj != this /* when embedded */ && obj != parent() /* when standalone */ )
return FALSE; // not us
if ( e->type() == QEvent::Wheel)
{
QApplication::sendEvent(scrollbar, e);
}
#ifdef FAKE_CTRL_AND_ALT
static bool control = FALSE;
static bool alt = FALSE;
- // Has a keyboard with no CTRL and ALT keys, but we fake it:
+ qDebug(" Has a keyboard with no CTRL and ALT keys, but we fake it:");
bool dele=FALSE;
if ( e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease ) {
QKeyEvent* ke = (QKeyEvent*)e;
bool keydown = e->type() == QEvent::KeyPress || ke->isAutoRepeat();
switch (ke->key()) {
case Key_F9: // let this be "Control"
control = keydown;
e = new QKeyEvent(QEvent::KeyPress, Key_Control, 0, ke->state());
dele=TRUE;
break;
case Key_F13: // let this be "Alt"
alt = keydown;
e = new QKeyEvent(QEvent::KeyPress, Key_Alt, 0, ke->state());
dele=TRUE;
break;
default:
if ( control ) {
int a = toupper(ke->ascii())-64;
if ( a >= 0 && a < ' ' ) {
e = new QKeyEvent(e->type(), ke->key(),
a, ke->state()|ControlButton, QChar(a,0));
dele=TRUE;
}
}
if ( alt ) {
e = new QKeyEvent(e->type(), ke->key(),
ke->ascii(), ke->state()|AltButton, ke->text());
dele=TRUE;
}
}
}
#endif
if ( e->type() == QEvent::KeyPress )
{
QKeyEvent* ke = (QKeyEvent*)e;
-
actSel=0; // Key stroke implies a screen update, so TEWidget won't
// know where the current selection is.
+// qDebug("key pressed is 0x%x",ke->key());
+ if( ke->state() == ShiftButton && ke->key() == Key_Tab) { //lets hardcode this sucker
+// qDebug("key pressed 2 is 0x%x",ke->key());
+ emitText("\\"); // expose
+ } else
emit keyPressedSignal(ke); // expose
ke->accept();
#ifdef FAKE_CTRL_AND_ALT
if ( dele ) delete e;
#endif
return true; // stop the event
}
if ( e->type() == QEvent::Enter )
{
QObject::disconnect( (QObject*)cb, SIGNAL(dataChanged()),
this, SLOT(onClearSelection()) );
}
if ( e->type() == QEvent::Leave )
{
QObject::connect( (QObject*)cb, SIGNAL(dataChanged()),
this, SLOT(onClearSelection()) );
}
return QFrame::eventFilter( obj, e );
}
/* ------------------------------------------------------------------------- */
/* */
/* Frame */
/* */
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
@@ -147,49 +147,50 @@ static const char *commonCmds[] =
"fuser",
"hostname",
"kill",
"killall",
"ln",
"ping",
"mount",
"more",
"sort",
"touch",
"umount",
"mknod",
"netstat",
*/
"exit",
NULL
};
Konsole::Konsole(QWidget* parent, const char* name, WFlags fl) :
QMainWindow(parent, name, fl)
{
QStrList args;
- init("/bin/sh",args);
+ init("/bin/ash",args);
+// init("/bin/sh",args);
}
Konsole::Konsole(const char* name, const char* _pgm, QStrList & _args, int)
: QMainWindow(0, name)
{
init(_pgm,_args);
}
void Konsole::initCommandList()
{
// qDebug("Konsole::initCommandList");
Config cfg("Konsole");
cfg.setGroup("Commands");
commonCombo->setInsertionPolicy(QComboBox::AtCurrent);
commonCombo->clear();
if (cfg.readEntry("Commands Set","FALSE") == "FALSE") {
for (int i = 0; commonCmds[i] != NULL; i++) {
commonCombo->insertItem(commonCmds[i],i);
}
} else {
for (int i = 0; i < 100; i++) {
if (!(cfg.readEntry( QString::number(i),"")).isEmpty())
commonCombo->insertItem((cfg.readEntry( QString::number(i),"")));
}