awful.mouse: load finder
[awesome.git] / key.h
blob220530037d2545d4a0f9166df33575370ca77ac5
1 /*
2 * key.h - Keybinding helpers
4 * Copyright © 2009 Julien Danjou <julien@danjou.info>
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_KEY_H
23 #define AWESOME_KEY_H
25 #include "common/luaobject.h"
27 typedef struct keyb_t
29 LUA_OBJECT_HEADER
30 /** Key modifier */
31 uint16_t modifiers;
32 /** Keysym */
33 xcb_keysym_t keysym;
34 /** Keycode */
35 xcb_keycode_t keycode;
36 } keyb_t;
38 lua_class_t key_class;
39 LUA_OBJECT_FUNCS(key_class, keyb_t, key)
40 DO_ARRAY(keyb_t *, key, DO_NOTHING)
42 void key_class_setup(lua_State *);
44 bool key_press_lookup_string(xcb_keysym_t, char *, ssize_t);
45 xcb_keysym_t key_getkeysym(xcb_keycode_t, uint16_t);
47 void luaA_key_array_set(lua_State *, int, int, key_array_t *);
48 int luaA_key_array_get(lua_State *, int, key_array_t *);
50 int luaA_pushmodifiers(lua_State *, uint16_t);
51 uint16_t luaA_tomodifiers(lua_State *L, int ud);
53 #endif
55 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80