summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/widget_layer.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/widget_layer.cpp b/noncore/apps/opie-console/widget_layer.cpp
index 0364e66..6682708 100644
--- a/noncore/apps/opie-console/widget_layer.cpp
+++ b/noncore/apps/opie-console/widget_layer.cpp
@@ -17,58 +17,63 @@
17#include <string.h> 17#include <string.h>
18//#include < 18//#include <
19 19
20#include "common.h" 20#include "common.h"
21 21
22 22
23 23
24WidgetLayer::WidgetLayer( const Profile &config, QWidget *parent, const char *name ) : QFrame( parent, name ) 24WidgetLayer::WidgetLayer( const Profile &config, QWidget *parent, const char *name ) : QFrame( parent, name )
25{ 25{
26 // get the clipboard 26 // get the clipboard
27 m_clipboard = QApplication::clipboard(); 27 m_clipboard = QApplication::clipboard();
28 28
29 // when data on clipboard changes, clear selection 29 // when data on clipboard changes, clear selection
30 QObject::connect( (QObject*) m_clipboard, SIGNAL( dataChanged() ), 30 QObject::connect( (QObject*) m_clipboard, SIGNAL( dataChanged() ),
31 (QObject*)this, SLOT( onClearSelection() ) ); 31 (QObject*)this, SLOT( onClearSelection() ) );
32 32
33 // initialize vars: 33 // initialize vars:
34 m_lines = 1; 34 m_lines = 1;
35 m_columns = 1; 35 m_columns = 1;
36 m_resizing = false; 36 m_resizing = false;
37 37
38 // just for demonstrating 38 // just for demonstrating
39 //m_image = QArray<Character>( m_lines * m_columns ); 39 //m_image = QArray<Character>( m_lines * m_columns );
40 m_image = QArray<Character>( 1 ); 40 m_image = QArray<Character>( 1 );
41
42 // we need to install an event filter,
43 // to emit keypresses.
44 qApp->installEventFilter( this );
41 45
42} 46}
43 47
44 48
45WidgetLayer::~WidgetLayer() 49WidgetLayer::~WidgetLayer()
46{ 50{
47 // clean up 51 // clean up
48 delete m_image; 52 delete m_image;
49} 53}
50 54
55
51/* --------------------------------- audio ---------------------------------- */ 56/* --------------------------------- audio ---------------------------------- */
52 57
53void WidgetLayer::bell() 58void WidgetLayer::bell()
54{ 59{
55 QApplication::beep(); 60 QApplication::beep();
56} 61}
57 62
58bool WidgetLayer::eventFilter( QObject *obj, QEvent *e ) 63bool WidgetLayer::eventFilter( QObject *obj, QEvent *e )
59{ 64{
60 if ( (e->type() == QEvent::Accel || 65 if ( (e->type() == QEvent::Accel ||
61 e->type() == QEvent::AccelAvailable ) && qApp->focusWidget() == this ) { 66 e->type() == QEvent::AccelAvailable ) && qApp->focusWidget() == this ) {
62 static_cast<QKeyEvent *>( e )->ignore(); 67 static_cast<QKeyEvent *>( e )->ignore();
63 return true; 68 return true;
64 } 69 }
65 if ( obj != this /* when embedded */ && obj != parent() /* when standalone */ ) 70 if ( obj != this /* when embedded */ && obj != parent() /* when standalone */ )
66 return FALSE; // not us 71 return FALSE; // not us
67 72
68#ifdef FAKE_CTRL_AND_ALT 73#ifdef FAKE_CTRL_AND_ALT
69 static bool control = FALSE; 74 static bool control = FALSE;
70 static bool alt = FALSE; 75 static bool alt = FALSE;
71// qDebug(" Has a keyboard with no CTRL and ALT keys, but we fake it:"); 76// qDebug(" Has a keyboard with no CTRL and ALT keys, but we fake it:");
72 bool dele=FALSE; 77 bool dele=FALSE;
73 if ( e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease ) { 78 if ( e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease ) {
74 QKeyEvent* ke = (QKeyEvent*)e; 79 QKeyEvent* ke = (QKeyEvent*)e;