]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QCommandEdit.C
added files
[lyx.git] / src / frontends / qt2 / QCommandEdit.C
1 /**
2  * \file QCommandEdit.C
3  * Copyright 2002 the LyX Team
4  * Read the file COPYING
5  *
6  * \author John Levon <moz@compsoc.man.ac.uk>
7  */
8
9 #include "QCommandEdit.h"
10  
11 QCommandEdit::QCommandEdit(QWidget * parent)
12         : QLineEdit(parent)
13
14 }
15
16
17 void QCommandEdit::keyPressEvent(QKeyEvent * e)
18 {
19         switch (e->key()) {
20                 case Key_Escape:
21                         emit escapePressed();
22                         break;
23  
24                 case Key_Up:
25                         emit upPressed();
26                         break;
27
28                 case Key_Down:
29                         emit downPressed();
30                         break;
31
32                 case Key_Right:
33                         if (e->state() & ControlButton)
34                                 emit rightPressed();
35                         else
36                                 QLineEdit::keyPressEvent(e);
37                         break;
38
39                 default:
40                         QLineEdit::keyPressEvent(e);
41                         break;
42         }
43 }