Skip to content

Commit

Permalink
Shell: Mapping more key codes to Qt keys
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Jan 28, 2013
1 parent 21b2ef7 commit b007486
Showing 1 changed file with 34 additions and 5 deletions.
39 changes: 34 additions & 5 deletions doomsday/tools/shell/shell-text/src/cursesapp.cpp
Expand Up @@ -199,10 +199,6 @@ struct CursesApp::Instance
// Control keys.
switch(key)
{
case 0x1b: // Escape
self.quit(); // development only
return;

case KEY_ENTER:
case 0xd: // Enter
code = Qt::Key_Enter;
Expand All @@ -212,6 +208,11 @@ struct CursesApp::Instance
code = Qt::Key_Backspace;
break;

case 0x3: // Ctrl-C
code = Qt::Key_C;
mods = KeyEvent::Control;
break;

case KEY_DC:
case 0x4: // Ctrl-D
code = Qt::Key_Delete;
Expand All @@ -221,6 +222,10 @@ struct CursesApp::Instance
code = Qt::Key_Backspace;
break;

case 0x9:
code = Qt::Key_Tab;
break;

case KEY_BTAB: // back-tab
code = Qt::Key_Backtab;
break;
Expand Down Expand Up @@ -251,11 +256,35 @@ struct CursesApp::Instance
code = Qt::Key_End;
break;

case 0xb: // Ctrl-K
case KEY_NPAGE:
case 0x16: // Ctrl-V
code = Qt::Key_PageDown;
break;

case KEY_PPAGE:
case 0x19: // Ctrl-Y
code = Qt::Key_PageUp;
break;

case 0xb:
code = Qt::Key_K;
mods = KeyEvent::Control;
break;

case KEY_F(9):
code = Qt::Key_F9;
break;

case 0x18:
code = Qt::Key_X;
mods = KeyEvent::Control;
break;

case 0x1a:
code = Qt::Key_Z;
mods = KeyEvent::Control;
break;

default:
if(key & KEY_CODE_YES)
qDebug() << "CURSES" << QString("0%1").arg(key, 0, 8).toAscii().constData();
Expand Down

0 comments on commit b007486

Please sign in to comment.