VirtualBox

source: vbox/trunk/src/VBox/RDP/client/keymaps/convert-map@ 42681

Last change on this file since 42681 was 37224, checked in by vboxsync, 14 years ago

RDP/client: fix OSE

  • Property svn:eol-style set to LF
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.8 KB
Line 
1#!/usr/bin/env python2
2# -*-Python-*-
3#
4#
5# Copyright (C) 2001 Peter Åstrand <astrand@cendio.se>
6#
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.
10#
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.
15#
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.
19
20import sys
21
22def main():
23 f = open(sys.argv[1])
24 while 1:
25 line = f.readline()
26 if not line: break
27
28 if line.startswith("#") or line.startswith("include"):
29 print line,
30 continue
31
32 fields = line.split()
33
34 if line.startswith("map"):
35 print "map 0x%s" % fields[1]
36 continue
37
38 scancode = fields[0]
39 for pos in range(1, len(fields)):
40 keysym = fields[pos]
41
42 if pos == 1:
43 modifiers = ""
44 elif pos == 2:
45 modifiers = "shift"
46 elif pos == 3:
47 modifiers = "altgr"
48 elif pos == 4:
49 modifiers = "shift altgr"
50 else:
51 raise("Invalid line: %s" % line)
52
53 print "%s 0x%s %s" % (keysym, scancode, modifiers)
54
55
56
57if __name__ == "__main__":
58 if len(sys.argv) < 2:
59 print "Convert old-style keymaps to new style"
60 print "Usage: %s <old-style-keymap>" % sys.argv[0]
61 sys.exit(1)
62 else:
63 main()
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette