From 91c7e5c378b1a639c6f5383915ed68b36b7735d4 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Fri, 24 Jan 2003 07:37:26 +0000 Subject: allow python to grab the keyboard. have release events go to the grabs callback. remove the modifier from teh state when a modifier key is the one being released --- src/python.hh | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src/python.hh') diff --git a/src/python.hh b/src/python.hh index d8b943e7..91d89b8a 100644 --- a/src/python.hh +++ b/src/python.hh @@ -53,6 +53,12 @@ enum KeyContext { NUM_KEY_CONTEXT }; +enum KeyAction { + EventKeyPress, + EventKeyRelease, + NUM_KEY_ACTION +}; + enum EventAction { EventEnterWindow, EventLeaveWindow, @@ -61,10 +67,9 @@ enum EventAction { EventCloseWindow, EventStartup, EventShutdown, - EventKey, EventFocus, EventBell, - EventUrgentNotify, + EventUrgentWindow, NUM_EVENTS }; @@ -148,18 +153,18 @@ public: Client *client; Time time; unsigned int state; - std::string key; - EventAction action; // this is here so that all the Data structs have .action + char *key; + KeyAction action; KeyData(int screen, Client *client, Time time, unsigned int state, - unsigned int key) { + unsigned int key, KeyAction action) { this->screen = screen; this->client = client; this->time = time; this->state = state; this->key = XKeysymToString(XKeycodeToKeysym(**otk::display, key, 0)); - this->action = EventKey; + this->action = action; } }; @@ -187,6 +192,9 @@ PyObject *mbind(const std::string &button, ob::MouseContext context, PyObject *kbind(PyObject *keylist, ob::KeyContext context, PyObject *func); +PyObject *kgrab(PyObject *func); +PyObject *kungrab(); + PyObject *ebind(ob::EventAction action, PyObject *func); void set_reset_key(const std::string &key); -- cgit v1.2.3