1 # Convert the original keymap_template.svg file to C program file
2 # Reformat to use data in the style of the gtk accelerator map routines
3 # awk -f keymap.awk keymap_template.svg > ../src/keymap_template.c
7 print " * Copyright (C) 2004 John Ellis"
8 print " * Copyright (C) 2008 - 2016 The Geeqie Team"
10 print " * Author: John Ellis"
12 print " * This program is free software; you can redistribute it and/or modify"
13 print " * it under the terms of the GNU General Public License as published by"
14 print " * the Free Software Foundation; either version 2 of the License, or"
15 print " * (at your option) any later version."
17 print " * This program is distributed in the hope that it will be useful,"
18 print " * but WITHOUT ANY WARRANTY; without even the implied warranty of"
19 print " * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the"
20 print " * GNU General Public License for more details."
22 print " * You should have received a copy of the GNU General Public License along"
23 print " * with this program; if not, write to the Free Software Foundation, Inc.,"
24 print " * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA."
27 print "static char *keymap_template [] = {"
32 gsub(/<control>/,"\\<Primary\\>")
33 gsub(/<meta>/,"\\<Alt\\>")
34 gsub(/<shift>/,"\\<Shift\\>")
35 gsub(/<super>/,"\\<Super\\>")
36 gsub(/<Shift><Primary>/,"\\<Primary\\>\\<Shift\\>")
37 gsub(/<Alt><Shift>/,"\\<Shift\\>\\<Alt\\>")
38 gsub(/<Alt><Primary>/,"\\<Primary\\>\\<Alt\\>")
46 keycodes[0,1]="parenright"
48 keycodes[1,1]="exclam"
50 keycodes[2,1]="quotedbl"
52 keycodes[3,1]="sterling"
54 keycodes[4,1]="dollar"
56 keycodes[5,1]="percent"
58 keycodes[6,1]="asciicircum"
60 keycodes[7,1]="ampersand"
62 keycodes[8,1]="asterisk"
64 keycodes[9,1]="parenleft"
65 keycodes[10,0]="minus"
66 keycodes[10,1]="underscore"
67 keycodes[11,0]="equal"
69 keycodes[12,0]="bracketleft"
70 keycodes[12,1]="braceleft"
71 keycodes[13,0]="bracketright"
72 keycodes[13,1]="braceright"
73 keycodes[14,0]="minus"
74 keycodes[14,1]="underscore"
75 keycodes[15,0]="semicolon"
76 keycodes[15,1]="colon"
77 keycodes[16,0]="apostrophe"
79 keycodes[17,0]="numbersign"
80 keycodes[17,1]="asciitilde"
81 keycodes[18,0]="comma"
83 keycodes[19,0]="period"
84 keycodes[19,1]="greater"
85 keycodes[20,0]="slash"
86 keycodes[20,1]="question"
87 keycodes[21,0]="grave"
88 keycodes[21,1]="notsign"
89 keycodes[22,0]="backslash"
94 gsub("Shift>"keycodes[i,0],"Shift\\>"keycodes[i,1])
95 gsub("Primary><Shift>"keycodes[i,0],"Primary\\>\\<Shift\\>"keycodes[i,1])
96 gsub("Shift><Alt>"keycodes[i,0],"Shift\\>\\<Alt\\>"keycodes[i,1])