VirtualBox

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

最後變更 在這個檔案從67265是 55121,由 vboxsync 提交於 10 年 前

rdesktop 1.8.3 unmodified

  • 屬性 svn:eol-style 設為 LF
  • 屬性 svn:executable 設為 *
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 1.8 KB
 
1#!/usr/bin/env python2
2# -*-Python-*-
3#
4# Copyright 2001 Peter Åstrand <[email protected]> for Cendio AB
5#
6# This program is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; version 2 of the License.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
19import sys
20
21def main():
22 f = open(sys.argv[1])
23 while 1:
24 line = f.readline()
25 if not line: break
26
27 if line.startswith("#") or line.startswith("include"):
28 print line,
29 continue
30
31 fields = line.split()
32
33 if line.startswith("map"):
34 print "map 0x%s" % fields[1]
35 continue
36
37 scancode = fields[0]
38 for pos in range(1, len(fields)):
39 keysym = fields[pos]
40
41 if pos == 1:
42 modifiers = ""
43 elif pos == 2:
44 modifiers = "shift"
45 elif pos == 3:
46 modifiers = "altgr"
47 elif pos == 4:
48 modifiers = "shift altgr"
49 else:
50 raise("Invalid line: %s" % line)
51
52 print "%s 0x%s %s" % (keysym, scancode, modifiers)
53
54
55
56if __name__ == "__main__":
57 if len(sys.argv) < 2:
58 print "Convert old-style keymaps to new style"
59 print "Usage: %s <old-style-keymap>" % sys.argv[0]
60 sys.exit(1)
61 else:
62 main()
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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