diff options
Diffstat (limited to 'src/Keys.cc')
-rw-r--r-- | src/Keys.cc | 41 |
1 files changed, 38 insertions, 3 deletions
diff --git a/src/Keys.cc b/src/Keys.cc index 54ae77a..079bdb6 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.9 2002/01/21 01:48:47 fluxgen Exp $ | 22 | //$Id: Keys.cc,v 1.10 2002/02/20 23:10:48 fluxgen Exp $ |
23 | 23 | ||
24 | #ifdef HAVE_CONFIG_H | 24 | #ifdef HAVE_CONFIG_H |
25 | # include "config.h" | 25 | # include "config.h" |
@@ -81,6 +81,7 @@ Keys::t_actionstr Keys::m_actionlist[] = { | |||
81 | {"Lower", LOWER}, | 81 | {"Lower", LOWER}, |
82 | {"Close", CLOSE}, | 82 | {"Close", CLOSE}, |
83 | {"AbortKeychain", ABORTKEYCHAIN}, | 83 | {"AbortKeychain", ABORTKEYCHAIN}, |
84 | {"Workspace", WORKSPACE}, | ||
84 | {"Workspace1", WORKSPACE1}, | 85 | {"Workspace1", WORKSPACE1}, |
85 | {"Workspace2", WORKSPACE2}, | 86 | {"Workspace2", WORKSPACE2}, |
86 | {"Workspace3", WORKSPACE3}, | 87 | {"Workspace3", WORKSPACE3}, |
@@ -269,10 +270,41 @@ bool Keys::load(char *filename) { | |||
269 | } | 270 | } |
270 | 271 | ||
271 | last_key->action = m_actionlist[i].action; | 272 | last_key->action = m_actionlist[i].action; |
272 | if (last_key->action == Keys::EXECUTE) | 273 | switch(last_key->action) { |
274 | case Keys::EXECUTE: | ||
273 | last_key->execcommand = | 275 | last_key->execcommand = |
274 | const_cast<char *>(StringUtil::strcasestr(linebuffer.get(), getActionStr(Keys::EXECUTE))+ | 276 | const_cast<char *> |
277 | (StringUtil::strcasestr(linebuffer.get(), | ||
278 | getActionStr(Keys::EXECUTE))+ | ||
275 | strlen(getActionStr(Keys::EXECUTE))); | 279 | strlen(getActionStr(Keys::EXECUTE))); |
280 | break; | ||
281 | case WORKSPACE: | ||
282 | if (argc + 1 < val.size()) | ||
283 | last_key->param = atoi( val[argc+1].c_str()); | ||
284 | else | ||
285 | last_key->param = 0; | ||
286 | break; | ||
287 | case LEFTWORKSPACE: | ||
288 | case RIGHTWORKSPACE: | ||
289 | case NEXTWORKSPACE: | ||
290 | case PREVWORKSPACE: | ||
291 | if (argc + 1 < val.size()) | ||
292 | last_key->param = atoi( val[argc+1].c_str()); | ||
293 | else | ||
294 | last_key->param = 1; | ||
295 | break; | ||
296 | case NUDGERIGHT: | ||
297 | case NUDGELEFT: | ||
298 | case NUDGEUP: | ||
299 | case NUDGEDOWN: | ||
300 | if (argc + 1 < val.size()) | ||
301 | last_key->param = atoi( val[argc+1].c_str()); | ||
302 | else | ||
303 | last_key->param = 2; | ||
304 | break; | ||
305 | default: | ||
306 | break; | ||
307 | } | ||
276 | 308 | ||
277 | //add the keychain to list | 309 | //add the keychain to list |
278 | if (!mergeTree(current_key)) | 310 | if (!mergeTree(current_key)) |
@@ -421,6 +453,7 @@ Keys::KeyAction Keys::getAction(XKeyEvent *ke) { | |||
421 | } else { | 453 | } else { |
422 | if (m_keylist[i]->action == Keys::EXECUTE) | 454 | if (m_keylist[i]->action == Keys::EXECUTE) |
423 | m_execcmdstring = m_keylist[i]->execcommand; //update execcmdstring if action is grabExecute | 455 | m_execcmdstring = m_keylist[i]->execcommand; //update execcmdstring if action is grabExecute |
456 | m_param = m_keylist[i]->param; | ||
424 | return m_keylist[i]->action; | 457 | return m_keylist[i]->action; |
425 | } | 458 | } |
426 | } | 459 | } |
@@ -560,6 +593,7 @@ Keys::t_key::t_key(unsigned int key_, unsigned int mod_, KeyAction action_) { | |||
560 | action = action_; | 593 | action = action_; |
561 | key = key_; | 594 | key = key_; |
562 | mod = mod_; | 595 | mod = mod_; |
596 | param = 0; | ||
563 | } | 597 | } |
564 | 598 | ||
565 | Keys::t_key::t_key(t_key *k) { | 599 | Keys::t_key::t_key(t_key *k) { |
@@ -567,6 +601,7 @@ Keys::t_key::t_key(t_key *k) { | |||
567 | key = k->key; | 601 | key = k->key; |
568 | mod = k->mod; | 602 | mod = k->mod; |
569 | execcommand = k->execcommand; | 603 | execcommand = k->execcommand; |
604 | param = k-> param; | ||
570 | } | 605 | } |
571 | 606 | ||
572 | Keys::t_key::~t_key() { | 607 | Keys::t_key::~t_key() { |