From 843f9726ab6fd99fe3a2f285e6c85bd2880a275f Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sat, 20 Jul 2002 16:26:37 +0000 Subject: [PATCH] add execute command. add string to action class. --- util/epist/actions.cc | 11 +++++++++-- util/epist/actions.hh | 5 +++++ util/epist/epist.cc | 2 +- util/epist/screen.cc | 2 +- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/util/epist/actions.cc b/util/epist/actions.cc index 493d0215..35ddbb80 100644 --- a/util/epist/actions.cc +++ b/util/epist/actions.cc @@ -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) { } diff --git a/util/epist/actions.hh b/util/epist/actions.hh index 6ae4e7ff..81b3920c 100644 --- a/util/epist/actions.hh +++ b/util/epist/actions.hh @@ -28,6 +28,7 @@ extern "C" { } #include +#include 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 ActionList; diff --git a/util/epist/epist.cc b/util/epist/epist.cc index b9dac6a8..1a4b4c24 100644 --- a/util/epist/epist.cc +++ b/util/epist/epist.cc @@ -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(); } diff --git a/util/epist/screen.cc b/util/epist/screen.cc index 98ad67f2..ce068122 100644 --- a/util/epist/screen.cc +++ b/util/epist/screen.cc @@ -202,7 +202,7 @@ void screen::handleKeypress(const XEvent &e) { return; case Action::execute: - execCommand("aterm"); + execCommand(it->string()); return; } -- 2.39.2