aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2002-02-20 23:12:07 (GMT)
committerfluxgen <fluxgen>2002-02-20 23:12:07 (GMT)
commitdf11c56ca0fa1fec52a7d7c50f7138f4c6be4972 (patch)
tree7c76fcfc8b7199f55003ffb2519273d9b0db32c5
parent2903379c490116f86f1380c8c648cfb57f68e848 (diff)
downloadfluxbox-df11c56ca0fa1fec52a7d7c50f7138f4c6be4972.zip
fluxbox-df11c56ca0fa1fec52a7d7c50f7138f4c6be4972.tar.bz2
using parameter value for key actions
-rw-r--r--src/fluxbox.cc28
1 files changed, 17 insertions, 11 deletions
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index 2ad0e6f..5690b6e 100644
--- a/src/fluxbox.cc
+++ b/src/fluxbox.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: fluxbox.cc,v 1.34 2002/02/17 18:43:30 fluxgen Exp $ 25// $Id: fluxbox.cc,v 1.35 2002/02/20 23:12:07 fluxgen Exp $
26 26
27//Use some GNU extensions 27//Use some GNU extensions
28#ifndef _GNU_SOURCE 28#ifndef _GNU_SOURCE
@@ -1059,6 +1059,11 @@ void Fluxbox::handleKeyEvent(XKeyEvent &ke) {
1059 break; 1059 break;
1060 1060
1061 switch (action) { 1061 switch (action) {
1062 case Keys::WORKSPACE:
1063 // Workspace1 has id 0, hence -1
1064 screen->changeWorkspaceID(key->getParam()-1);
1065 break;
1066 // NOTE!!! The WORKSPACEn commands are not needed anymore
1062 case Keys::WORKSPACE1: 1067 case Keys::WORKSPACE1:
1063 screen->changeWorkspaceID(0); 1068 screen->changeWorkspaceID(0);
1064 break; 1069 break;
@@ -1096,16 +1101,16 @@ void Fluxbox::handleKeyEvent(XKeyEvent &ke) {
1096 screen->changeWorkspaceID(11); 1101 screen->changeWorkspaceID(11);
1097 break; 1102 break;
1098 case Keys::NEXTWORKSPACE: 1103 case Keys::NEXTWORKSPACE:
1099 screen->nextWorkspace(); 1104 screen->nextWorkspace(key->getParam());
1100 break; 1105 break;
1101 case Keys::PREVWORKSPACE: 1106 case Keys::PREVWORKSPACE:
1102 screen->prevWorkspace(); 1107 screen->prevWorkspace(key->getParam());
1103 break; 1108 break;
1104 case Keys::LEFTWORKSPACE: 1109 case Keys::LEFTWORKSPACE:
1105 screen->leftWorkspace(); 1110 screen->leftWorkspace(key->getParam());
1106 break; 1111 break;
1107 case Keys::RIGHTWORKSPACE: 1112 case Keys::RIGHTWORKSPACE:
1108 screen->rightWorkspace(); 1113 screen->rightWorkspace(key->getParam());
1109 break; 1114 break;
1110 case Keys::KILLWINDOW: //kill the current window 1115 case Keys::KILLWINDOW: //kill the current window
1111 XKillClient(screen->getBaseDisplay()->getXDisplay(), 1116 XKillClient(screen->getBaseDisplay()->getXDisplay(),
@@ -1166,7 +1171,7 @@ void Fluxbox::handleKeyEvent(XKeyEvent &ke) {
1166 } 1171 }
1167 break; 1172 break;
1168 default: //try to see if its a window action 1173 default: //try to see if its a window action
1169 doWindowAction(action); 1174 doWindowAction(action, key->getParam());
1170 } 1175 }
1171 } 1176 }
1172 break; 1177 break;
@@ -1178,7 +1183,7 @@ void Fluxbox::handleKeyEvent(XKeyEvent &ke) {
1178 1183
1179 1184
1180} 1185}
1181void Fluxbox::doWindowAction(Keys::KeyAction action) { 1186void Fluxbox::doWindowAction(Keys::KeyAction action, const int param) {
1182 if (!focused_window) 1187 if (!focused_window)
1183 return; 1188 return;
1184 1189
@@ -1224,24 +1229,25 @@ void Fluxbox::doWindowAction(Keys::KeyAction action) {
1224 break; 1229 break;
1225 case Keys::NUDGERIGHT: 1230 case Keys::NUDGERIGHT:
1226 focused_window->configure( 1231 focused_window->configure(
1227 focused_window->getXFrame()+1, focused_window->getYFrame(), 1232 focused_window->getXFrame()+param, focused_window->getYFrame(),
1228 focused_window->getWidth(), focused_window->getHeight()); 1233 focused_window->getWidth(), focused_window->getHeight());
1229 break; 1234 break;
1230 case Keys::NUDGELEFT: 1235 case Keys::NUDGELEFT:
1231 focused_window->configure( 1236 focused_window->configure(
1232 focused_window->getXFrame()-1, focused_window->getYFrame(), 1237 focused_window->getXFrame()-param, focused_window->getYFrame(),
1233 focused_window->getWidth(), focused_window->getHeight()); 1238 focused_window->getWidth(), focused_window->getHeight());
1234 break; 1239 break;
1235 case Keys::NUDGEUP: 1240 case Keys::NUDGEUP:
1236 focused_window->configure( 1241 focused_window->configure(
1237 focused_window->getXFrame(), focused_window->getYFrame()-1, 1242 focused_window->getXFrame(), focused_window->getYFrame()-param,
1238 focused_window->getWidth(), focused_window->getHeight()); 1243 focused_window->getWidth(), focused_window->getHeight());
1239 break; 1244 break;
1240 case Keys::NUDGEDOWN: 1245 case Keys::NUDGEDOWN:
1241 focused_window->configure( 1246 focused_window->configure(
1242 focused_window->getXFrame(), focused_window->getYFrame()+1, 1247 focused_window->getXFrame(), focused_window->getYFrame()+param,
1243 focused_window->getWidth(), focused_window->getHeight()); 1248 focused_window->getWidth(), focused_window->getHeight());
1244 break; 1249 break;
1250 // NOTE !!! BIGNUDGExxxx is not needed, just use 10 as a parameter
1245 case Keys::BIGNUDGERIGHT: 1251 case Keys::BIGNUDGERIGHT:
1246 focused_window->configure( 1252 focused_window->configure(
1247 focused_window->getXFrame()+10, focused_window->getYFrame(), 1253 focused_window->getXFrame()+10, focused_window->getYFrame(),