-rw-r--r-- | core/launcher/desktop.cpp | 19 | ||||
-rw-r--r-- | core/launcher/desktop.h | 2 | ||||
-rw-r--r-- | core/settings/button/buttonsettings.cpp | 3 | ||||
-rw-r--r-- | core/settings/button/buttonutils.cpp | 3 | ||||
-rw-r--r-- | core/settings/button/remapdlg.cpp | 24 |
5 files changed, 39 insertions, 12 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp index 59f2aea..fbcce7c 100644 --- a/core/launcher/desktop.cpp +++ b/core/launcher/desktop.cpp @@ -344,3 +344,3 @@ void DesktopApplication::sendHeldAction ( ) -void DesktopApplication::checkButtonAction ( const ODeviceButton *db, int /*keycode*/, bool press, bool autoRepeat ) +bool DesktopApplication::checkButtonAction ( const ODeviceButton *db, int /*keycode*/, bool press, bool autoRepeat ) { @@ -349,5 +349,10 @@ void DesktopApplication::checkButtonAction ( const ODeviceButton *db, int /*keyc m_button_timer-> stop ( ); - if ( !db-> pressedAction ( ). channel ( ). isEmpty ( )) { + + if (!db-> pressedAction ( ). channel ( ) .isEmpty()) + { + if ( db-> pressedAction ( ). channel ( )!="ignore") { db-> pressedAction ( ). send ( ); } + else return false; + } } @@ -355,4 +360,6 @@ void DesktopApplication::checkButtonAction ( const ODeviceButton *db, int /*keyc m_button_timer-> stop ( ); + if (!db-> pressedAction ( ). channel ( ) .isEmpty()) + { - if ( !db-> heldAction ( ). channel ( ). isEmpty ( )) { + if ( db-> heldAction ( ). channel ( )!="ignore") { m_last_button = db; @@ -360,2 +367,3 @@ void DesktopApplication::checkButtonAction ( const ODeviceButton *db, int /*keyc } + else return false; } @@ -363,2 +371,4 @@ void DesktopApplication::checkButtonAction ( const ODeviceButton *db, int /*keyc } + return true; +} @@ -372,4 +382,3 @@ bool DesktopApplication::eventFilter ( QObject *o, QEvent *e ) if ( db ) { - checkButtonAction ( db, ke-> key ( ), e-> type ( ) == QEvent::KeyPress, ke-> isAutoRepeat ( )); - return true; + return checkButtonAction ( db, ke-> key ( ), e-> type ( ) == QEvent::KeyPress, ke-> isAutoRepeat ( )); } diff --git a/core/launcher/desktop.h b/core/launcher/desktop.h index db0173e..4024c38 100644 --- a/core/launcher/desktop.h +++ b/core/launcher/desktop.h @@ -85,3 +85,3 @@ protected: virtual bool eventFilter ( QObject *o, QEvent *e ); - void checkButtonAction ( const Opie::ODeviceButton *db, int keycode, bool press, bool autoRepeat ); + bool checkButtonAction ( const Opie::ODeviceButton *db, int keycode, bool press, bool autoRepeat ); diff --git a/core/settings/button/buttonsettings.cpp b/core/settings/button/buttonsettings.cpp index eabb779..942d5e4 100644 --- a/core/settings/button/buttonsettings.cpp +++ b/core/settings/button/buttonsettings.cpp @@ -210,3 +210,2 @@ void ButtonSettings::edit ( buttoninfo *bi, bool hold ) { - qDebug ( "remap %s for %s", hold ? "hold" : "press", bi-> m_button-> userText ( ). latin1 ( )); @@ -220,3 +219,3 @@ void ButtonSettings::edit ( buttoninfo *bi, bool hold ) if ( d-> exec ( ) == QDialog::Accepted ) { - qDebug ( " -> %s %s", d-> message ( ). channel ( ). data ( ), d-> message ( ). message ( ). data ( )); + diff --git a/core/settings/button/buttonutils.cpp b/core/settings/button/buttonutils.cpp index 91d2af3..27a2f38 100644 --- a/core/settings/button/buttonutils.cpp +++ b/core/settings/button/buttonutils.cpp @@ -67,3 +67,4 @@ qCopInfo ButtonUtils::messageToInfo ( const OQCopMessage &c ) - if ( ch. isNull ( )) + + if ( ch == "ignore" ) return qCopInfo ( qApp-> translate ( "ButtonSettings", "<nobr>Ignored</nobr>" )); diff --git a/core/settings/button/remapdlg.cpp b/core/settings/button/remapdlg.cpp index a251bd4..b6ee60b 100644 --- a/core/settings/button/remapdlg.cpp +++ b/core/settings/button/remapdlg.cpp @@ -61,3 +61,14 @@ RemapDlg::RemapDlg ( const Opie::ODeviceButton *b, bool hold, QWidget *parent, c ((NoSortItem *) m_map_preset )-> setDefault ( true ); + + if (m_msg. channel ( ) == "ignore") + { + m_map_custom = new NoSortItem ( w_list, 2, tr( "Custom" ), m_msg_preset. channel ( ), m_msg_preset. message ( )); + + m_current = m_map_none; + } + else + { m_map_custom = new NoSortItem ( w_list, 2, tr( "Custom" ), m_msg. channel ( ), m_msg. message ( )); + m_current = m_map_custom; + } @@ -69,3 +80,2 @@ RemapDlg::RemapDlg ( const Opie::ODeviceButton *b, bool hold, QWidget *parent, c - m_current = m_map_custom; w_list-> setCurrentItem ( m_current ); @@ -99,6 +109,14 @@ void RemapDlg::itemChanged ( QListViewItem *it ) if ( it == m_map_none ) - m_msg = m = OQCopMessage ( 0, 0 ); + { + m_msg = m = OQCopMessage ( "ignore", 0 ); + qDebug ("***ignoring"); + } else if ( it == m_map_preset ) + { m_msg = m = m_msg_preset; - else if ( it && !it-> childCount ( )) { + qDebug ("***Preset"); + } + else if ( it && !it-> childCount ( )) + { + qDebug ("***Custom: %s %s ",it-> text ( 1 ). latin1 ( ), it-> text ( 2 ). latin1 ( )); enabled = ( it == m_map_custom ); |