5
# Copyright (C) 2001 Peter Åstrand <astrand@cendio.se>
7
# This program is free software; you can redistribute it and/or modify
8
# it under the terms of the GNU General Public License as published by
9
# the Free Software Foundation; version 2 of the License.
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
17
# along with this program; if not, write to the Free Software
18
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28
if line.startswith("#") or line.startswith("include"):
34
if line.startswith("map"):
35
print "map 0x%s" % fields[1]
39
for pos in range(1, len(fields)):
49
modifiers = "shift altgr"
51
raise("Invalid line: %s" % line)
53
print "%s 0x%s %s" % (keysym, scancode, modifiers)
57
if __name__ == "__main__":
59
print "Convert old-style keymaps to new style"
60
print "Usage: %s <old-style-keymap>" % sys.argv[0]