summaryrefslogtreecommitdiff
path: root/libopie2
authorzecke <zecke>2004-03-29 01:17:56 (UTC)
committer zecke <zecke>2004-03-29 01:17:56 (UTC)
commit28648c47d06c339ee893f8cef740bae9d54863bf (patch) (side-by-side diff)
treedf9b02dfca6f64cb017c5225a3730336d3ea3fdb /libopie2
parent3af77639ad7a1f5acf66220fe493df424e40f949 (diff)
downloadopie-28648c47d06c339ee893f8cef740bae9d54863bf.zip
opie-28648c47d06c339ee893f8cef740bae9d54863bf.tar.gz
opie-28648c47d06c339ee893f8cef740bae9d54863bf.tar.bz2
One more keyboard action
Diffstat (limited to 'libopie2') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/examples/opieui/okeyconfigwidget/testwidget.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/libopie2/examples/opieui/okeyconfigwidget/testwidget.cpp b/libopie2/examples/opieui/okeyconfigwidget/testwidget.cpp
index 329df09..5553166 100644
--- a/libopie2/examples/opieui/okeyconfigwidget/testwidget.cpp
+++ b/libopie2/examples/opieui/okeyconfigwidget/testwidget.cpp
@@ -84,8 +84,10 @@ TestMainWindow::TestMainWindow( QWidget* parent, const char* slot, WFlags fl )
blackList, false, this, "Key Manager" );
m_manager->addKeyConfig( Opie::Ui::OKeyConfigItem( tr( "Delete Action" ), "delete_key", QPixmap(),
- 10, Opie::Ui::OKeyPair( Qt::Key_D, 0 ), this,
+ 10, Opie::Ui::OKeyPair( Qt::Key_D, Qt::ShiftButton ), this,
SLOT(slotDelete(QWidget*,QKeyEvent*)) ) );
+ m_manager->addKeyConfig( Opie::Ui::OKeyConfigItem( tr( "Show Action" ), "show_key", QPixmap(),
+ 11, Opie::Ui::OKeyPair( Qt::Key_S, Qt::AltButton ) ) );
connect(m_manager, SIGNAL(actionActivated(QWidget*,QKeyEvent*,const Opie::Ui::OKeyConfigItem&)),
this, SLOT(slotAction(QWidget*, QKeyEvent*, const Opie::Ui::OKeyConfigItem&)) );
@@ -96,6 +98,7 @@ TestMainWindow::TestMainWindow( QWidget* parent, const char* slot, WFlags fl )
TestMainWindow::~TestMainWindow() {
m_manager->save();
+ delete m_config;
}
Opie::Ui::OKeyConfigManager* TestMainWindow::manager() {
@@ -108,7 +111,8 @@ Opie::Ui::OKeyConfigManager* TestMainWindow::manager() {
*/
void TestMainWindow::keyPressEvent( QKeyEvent* ev ) {
qWarning( "String is "+ m_manager->handleKeyEvent( ev ).text() );
- qWarning( "Id was %d", m_manager->handleKeyEventId( ev ) );
+ qWarning( "Id was %d %d %d %d", m_manager->handleKeyEventId( ev ),ev->key(),ev->state(), ev->ascii() );
+ ev->ignore();
}
void TestMainWindow::slotDelete( QWidget* wid, QKeyEvent* ev ) {