VirtualBox

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

最後變更 在這個檔案從52822是 37224,由 vboxsync 提交於 14 年 前

RDP/client: fix OSE

  • 屬性 svn:eol-style 設為 LF
  • 屬性 svn:executable 設為 *
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 1.8 KB
 
1#!/usr/bin/env python2
2# -*-Python-*-
3#
4#
5# Copyright (C) 2001 Peter Åstrand <[email protected]>
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()
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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