4
Script to create the "glspi_keycmd.h" file.
7
../geany/src/keybindings.h relative to the current directory.
8
"lua" and "cpp" somewhere in your $PATH
10
Note that you should invoke this script from the top-level /geanylua/
11
directory, not from /geanylua/util/
13
The only time you need this is if the keybinding group-IDs or key-IDs
14
in /geany/src/keybindings.h have changed. But it is certainly possible
15
for that file to have been altered so radically that this script will
26
"cpp -P `pkg-config --cflags gtk+-2.0` -I../geany/src util/keydummy.h"
29
for line in cpp:lines()
31
if line:find("^[ \t]*GEANY_KEYS_") and not line:find("^[ \t]*GEANY_KEYS_GROUP")
33
name=line:gsub("^[ \t]*GEANY_KEYS_([^ \t,]+).*$", "%1")
34
table.insert(names, name)
43
******************* !!! IMPORTANT !!! ***************************
45
* This is a machine generated file, do not edit by hand!
46
* If you need to modify this file, see "geanylua/util/mk-keytab.lua"
48
*******************************************************************
56
print("typedef struct _KeyCmdHashEntry {")
57
print("\tgchar *name;")
58
print("\tguint group;")
59
print("\tguint key_id;")
60
print("} KeyCmdHashEntry;")
63
print("static KeyCmdHashEntry key_cmd_hash_entries[] = {")
65
for num,name in pairs(names)
68
string.format("\t{\"%s\", GEANY_KEY_GROUP_%s, GEANY_KEYS_%s},",
69
name, name:gsub("_.*", ""), name)
73
print("\t{NULL, 0, 0}")