diff --git a/kwinbindings.cpp b/kwinbindings.cpp index caff669caa..d56062ec46 100644 --- a/kwinbindings.cpp +++ b/kwinbindings.cpp @@ -6,7 +6,8 @@ keys->insertItem(i18n("Switch to desktop 6"), "Switch to desktop 6" ,"CTRL+F6"); keys->insertItem(i18n("Switch to desktop 7"), "Switch to desktop 7" ,"CTRL+F7"); keys->insertItem(i18n("Switch to desktop 8"), "Switch to desktop 8" ,"CTRL+F8"); - + keys->insertItem(i18n("Switch one desktop to the left"), "Switch desktop left" ,""); + keys->insertItem(i18n("Switch one desktop to the right"), "Switch desktop right" ,""); keys->insertItem(i18n("Window operations menu"), "Pop-up window operations menu" ,"ALT+F3"); keys->insertItem(i18n("Window close"),"Window close", "ALT+F4"); diff --git a/workspace.cpp b/workspace.cpp index aac99cb04d..093b2d6024 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -1874,6 +1874,8 @@ void Workspace::createKeybindings(){ keys->connectItem( "Switch to desktop 6", this, SLOT( slotSwitchDesktop6() )); keys->connectItem( "Switch to desktop 7", this, SLOT( slotSwitchDesktop7() )); keys->connectItem( "Switch to desktop 8", this, SLOT( slotSwitchDesktop8() )); + keys->connectItem( "Switch desktop left", this, SLOT( slotSwitchDesktopLeft() )); + keys->connectItem( "Switch desktop right", this, SLOT( slotSwitchDesktopRight() )); keys->connectItem( "Pop-up window operations menu", this, SLOT( slotWindowOperations() ) ); keys->connectItem( "Window close", this, SLOT( slotWindowClose() ) ); @@ -1917,8 +1919,18 @@ void Workspace::slotSwitchDesktop7(){ void Workspace::slotSwitchDesktop8(){ setCurrentDesktop(8); } - - +void Workspace::slotSwitchDesktopRight(){ + int d = currentDesktop() + 1; + if ( d > number_of_desktops ) + d = 1; + setCurrentDesktop(d); +} +void Workspace::slotSwitchDesktopLeft(){ + int d = currentDesktop() - 1; + if ( d <= 0 ) + d = number_of_desktops; + setCurrentDesktop(d); +} /*! Maximizes the popup client diff --git a/workspace.h b/workspace.h index ffa0ee8ce1..fa3d98026c 100644 --- a/workspace.h +++ b/workspace.h @@ -187,6 +187,8 @@ public slots: void slotSwitchDesktop6(); void slotSwitchDesktop7(); void slotSwitchDesktop8(); + void slotSwitchDesktopRight(); + void slotSwitchDesktopLeft(); void slotWindowMaximize(); void slotWindowMaximizeVertical();