#include "actions.hh"
Action::Action(enum ActionType type, KeyCode keycode, unsigned int modifierMask,
- int num): _type(type), _keycode(keycode),
- _modifierMask(modifierMask), _numberParam(num)
+ int num)
+ : _type(type), _keycode(keycode),
+ _modifierMask(modifierMask), _numberParam(num)
+{ }
+
+Action::Action(enum ActionType type, KeyCode keycode, unsigned int modifierMask,
+ const std::string &str)
+ : _type(type), _keycode(keycode),
+ _modifierMask(modifierMask), _stringParam(str)
{ }
}
#include <list>
+#include <string>
class Action {
public:
const unsigned int _modifierMask;
const int _numberParam;
+ const std::string _stringParam;
public:
inline enum ActionType type() const { return _type;}
inline const KeyCode keycode() const { return _keycode; }
inline const unsigned int modifierMask() const { return _modifierMask; }
inline const int number() const { return _numberParam; }
+ inline const std::string &string() const { return _stringParam; }
Action(enum ActionType type, KeyCode keycode, unsigned int modifierMask,
int number = 0);
+ Action(enum ActionType type, KeyCode keycode, unsigned int modifierMask,
+ const std::string &str);
};
typedef std::list<Action> ActionList;
_actions.push_back(Action(Action::execute,
XKeysymToKeycode(getXDisplay(),
XStringToKeysym("F6")),
- Mod1Mask));
+ Mod1Mask, "aterm"));
activateGrabs();
}
return;
case Action::execute:
- execCommand("aterm");
+ execCommand(it->string());
return;
}