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"
|
#include "actions.hh"
|
||||||
|
|
||||||
Action::Action(enum ActionType type, KeyCode keycode, unsigned int modifierMask,
|
Action::Action(enum ActionType type, KeyCode keycode, unsigned int modifierMask,
|
||||||
int num): _type(type), _keycode(keycode),
|
int num)
|
||||||
_modifierMask(modifierMask), _numberParam(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 <list>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
class Action {
|
class Action {
|
||||||
public:
|
public:
|
||||||
|
@ -81,14 +82,18 @@ private:
|
||||||
const unsigned int _modifierMask;
|
const unsigned int _modifierMask;
|
||||||
|
|
||||||
const int _numberParam;
|
const int _numberParam;
|
||||||
|
const std::string _stringParam;
|
||||||
public:
|
public:
|
||||||
inline enum ActionType type() const { return _type;}
|
inline enum ActionType type() const { return _type;}
|
||||||
inline const KeyCode keycode() const { return _keycode; }
|
inline const KeyCode keycode() const { return _keycode; }
|
||||||
inline const unsigned int modifierMask() const { return _modifierMask; }
|
inline const unsigned int modifierMask() const { return _modifierMask; }
|
||||||
inline const int number() const { return _numberParam; }
|
inline const int number() const { return _numberParam; }
|
||||||
|
inline const std::string &string() const { return _stringParam; }
|
||||||
|
|
||||||
Action(enum ActionType type, KeyCode keycode, unsigned int modifierMask,
|
Action(enum ActionType type, KeyCode keycode, unsigned int modifierMask,
|
||||||
int number = 0);
|
int number = 0);
|
||||||
|
Action(enum ActionType type, KeyCode keycode, unsigned int modifierMask,
|
||||||
|
const std::string &str);
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::list<Action> ActionList;
|
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,
|
_actions.push_back(Action(Action::execute,
|
||||||
XKeysymToKeycode(getXDisplay(),
|
XKeysymToKeycode(getXDisplay(),
|
||||||
XStringToKeysym("F6")),
|
XStringToKeysym("F6")),
|
||||||
Mod1Mask));
|
Mod1Mask, "aterm"));
|
||||||
activateGrabs();
|
activateGrabs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -202,7 +202,7 @@ void screen::handleKeypress(const XEvent &e) {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case Action::execute:
|
case Action::execute:
|
||||||
execCommand("aterm");
|
execCommand(it->string());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue