hooks: add exit hook
[awesome.git] / key.h
blob38dbd6995729654f9f05a6ff50a6623c8d4f630a
1 /*
2 * key.h - Keybinding helpers
4 * Copyright © 2008 Pierre Habouzit <madcoder@debian.org>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #ifndef AWESOME_KEYBINDING_H
23 #define AWESOME_KEYBINDING_H
25 #include "luaa.h"
27 typedef struct keyb_t
29 /** Lua references */
30 luaA_ref_array_t refs;
31 /** Key modifier */
32 uint16_t mod;
33 /** Keysym */
34 xcb_keysym_t keysym;
35 /** Keycode */
36 xcb_keycode_t keycode;
37 /** Lua function to execute on press */
38 luaA_ref press;
39 /** Lua function to execute on release */
40 luaA_ref release;
41 } keyb_t;
43 ARRAY_TYPE(keyb_t *, key)
45 bool key_press_lookup_string(xcb_keysym_t, char *, ssize_t);
46 xcb_keysym_t key_getkeysym(xcb_keycode_t, uint16_t);
48 void luaA_key_array_set(lua_State *, int, key_array_t *);
49 int luaA_key_array_get(lua_State *, key_array_t *);
51 void window_grabkeys(xcb_window_t, key_array_t *);
52 int luaA_pushmodifiers(lua_State *, uint16_t);
53 void luaA_setmodifiers(lua_State *, int, uint16_t *);
55 #endif