add execute command. add string to action class.
This commit is contained in:
parent
f32096dcd2
commit
843f9726ab
4 changed files with 16 additions and 4 deletions
|
@ -23,6 +23,13 @@
|
|||
#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)
|
||||
{ }
|
||||
|
|
|
@ -28,6 +28,7 @@ extern "C" {
|
|||
}
|
||||
|
||||
#include <list>
|
||||
#include <string>
|
||||
|
||||
class Action {
|
||||
public:
|
||||
|
@ -81,14 +82,18 @@ private:
|
|||
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;
|
||||
|
|
|
@ -159,7 +159,7 @@ epist::epist(char **argv, char *dpy_name, char *rc_file)
|
|||
_actions.push_back(Action(Action::execute,
|
||||
XKeysymToKeycode(getXDisplay(),
|
||||
XStringToKeysym("F6")),
|
||||
Mod1Mask));
|
||||
Mod1Mask, "aterm"));
|
||||
activateGrabs();
|
||||
}
|
||||
|
||||
|
|
|
@ -202,7 +202,7 @@ void screen::handleKeypress(const XEvent &e) {
|
|||
return;
|
||||
|
||||
case Action::execute:
|
||||
execCommand("aterm");
|
||||
execCommand(it->string());
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue