aboutsummaryrefslogtreecommitdiff
path: root/src/Keys.cc
diff options
context:
space:
mode:
authorrathnor <rathnor>2003-06-08 14:32:28 (GMT)
committerrathnor <rathnor>2003-06-08 14:32:28 (GMT)
commit81e4fe8d44a3f0bd8c104127d7785badab6f2bc8 (patch)
tree9258d23bdc8e8c9197075b3635e69bfde7565d15 /src/Keys.cc
parent93b2f8921c70e2cf5f2f2c3cf79943de54b6709b (diff)
downloadfluxbox-81e4fe8d44a3f0bd8c104127d7785badab6f2bc8.zip
fluxbox-81e4fe8d44a3f0bd8c104127d7785badab6f2bc8.tar.bz2
add reconfigure and restart keys
Diffstat (limited to 'src/Keys.cc')
-rw-r--r--src/Keys.cc21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/Keys.cc b/src/Keys.cc
index a9879b5..48db064 100644
--- a/src/Keys.cc
+++ b/src/Keys.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22//$Id: Keys.cc,v 1.27 2003/04/26 18:27:56 fluxgen Exp $ 22//$Id: Keys.cc,v 1.28 2003/06/08 14:32:28 rathnor Exp $
23 23
24 24
25#include "Keys.hh" 25#include "Keys.hh"
@@ -135,6 +135,8 @@ Keys::t_actionstr Keys::m_actionlist[] = {
135 {"ToggleDecor", TOGGLEDECOR}, 135 {"ToggleDecor", TOGGLEDECOR},
136 {"ToggleTab", TOGGLETAB}, 136 {"ToggleTab", TOGGLETAB},
137 {"RootMenu", ROOTMENU}, 137 {"RootMenu", ROOTMENU},
138 {"Reconfigure", RECONFIGURE},
139 {"Restart", RESTART},
138 {"Quit", QUIT}, 140 {"Quit", QUIT},
139 {0, LASTKEYGRAB} 141 {0, LASTKEYGRAB}
140}; 142};
@@ -294,12 +296,14 @@ bool Keys::load(const char *filename) {
294 296
295 last_key->action = m_actionlist[i].action; 297 last_key->action = m_actionlist[i].action;
296 switch(last_key->action) { 298 switch(last_key->action) {
299 case Keys::RESTART:
297 case Keys::EXECUTE: 300 case Keys::EXECUTE:
298 last_key->execcommand = 301 last_key->execcommand =
299 const_cast<char *> 302 const_cast<char *>
300 (FbTk::StringUtil::strcasestr(linebuffer.c_str(), 303 (FbTk::StringUtil::strcasestr(
301 getActionStr(Keys::EXECUTE))+ 304 linebuffer.c_str(),
302 strlen(getActionStr(Keys::EXECUTE))); 305 getActionStr(last_key->action))
306 + strlen(getActionStr(last_key->action)) + 1);
303 break; 307 break;
304 case WORKSPACE: 308 case WORKSPACE:
305 case SENDTOWORKSPACE: 309 case SENDTOWORKSPACE:
@@ -481,7 +485,8 @@ Keys::KeyAction Keys::getAction(XKeyEvent *ke) {
481 next_key = m_keylist[i]; 485 next_key = m_keylist[i];
482 break; //end for-loop 486 break; //end for-loop
483 } else { 487 } else {
484 if (m_keylist[i]->action == Keys::EXECUTE) 488 if (m_keylist[i]->action == Keys::EXECUTE ||
489 m_keylist[i]->action == Keys::RESTART)
485 m_execcmdstring = m_keylist[i]->execcommand; //update execcmdstring if action is grabExecute 490 m_execcmdstring = m_keylist[i]->execcommand; //update execcmdstring if action is grabExecute
486 m_param = m_keylist[i]->param; 491 m_param = m_keylist[i]->param;
487 return m_keylist[i]->action; 492 return m_keylist[i]->action;
@@ -496,14 +501,16 @@ Keys::KeyAction Keys::getAction(XKeyEvent *ke) {
496 next_key = temp_key; 501 next_key = temp_key;
497 } else { 502 } else {
498 next_key = 0; 503 next_key = 0;
499 if (temp_key->action == Keys::EXECUTE) 504 if (temp_key->action == Keys::EXECUTE ||
505 temp_key->action == Keys::RESTART)
500 m_execcmdstring = temp_key->execcommand; //update execcmdstring if action is grabExecute 506 m_execcmdstring = temp_key->execcommand; //update execcmdstring if action is grabExecute
501 return temp_key->action; 507 return temp_key->action;
502 } 508 }
503 } else { 509 } else {
504 temp_key = next_key; 510 temp_key = next_key;
505 next_key = 0; 511 next_key = 0;
506 if (temp_key->action == Keys::EXECUTE) 512 if (temp_key->action == Keys::EXECUTE ||
513 temp_key->action == Keys::RESTART)
507 m_execcmdstring = temp_key->execcommand; //update execcmdstring if action is grabExecute 514 m_execcmdstring = temp_key->execcommand; //update execcmdstring if action is grabExecute
508 return temp_key->action; 515 return temp_key->action;
509 } 516 }