16 |
# write to the Free Software Foundation, Inc., 59 Temple Place |
# write to the Free Software Foundation, Inc., 59 Temple Place |
17 |
# - Suite 330, Boston, MA 02111-1307, USA. |
# - Suite 330, Boston, MA 02111-1307, USA. |
18 |
# |
# |
19 |
# Copyright 2002 Free Software Foundation |
# Copyright 2002-2003 Free Software Foundation |
20 |
# |
# |
21 |
# FILE: |
# FILE: |
22 |
# GFKeyMapper.py |
# GFKeyMapper.py |
78 |
# |
# |
79 |
def loadUserKeyMap(self, dict): |
def loadUserKeyMap(self, dict): |
80 |
usermap = {} |
usermap = {} |
81 |
|
|
82 |
for event in dict.keys(): |
for event in dict.keys(): |
83 |
val = string.upper(dict[event]) |
val = string.upper(dict[event]) |
84 |
|
|
96 |
meta = 0 |
meta = 0 |
97 |
ctrl = 0 |
ctrl = 0 |
98 |
|
|
99 |
|
|
100 |
for key in keys: |
for key in keys: |
101 |
if key in ('CTRL','CONTROL'): |
if key in ('CTRL','CONTROL'): |
102 |
ctrl = 1 |
ctrl = 1 |
104 |
meta = 0 |
meta = 0 |
105 |
elif key in ('SHFT','SHIFT'): |
elif key in ('SHFT','SHIFT'): |
106 |
shifted = 0 |
shifted = 0 |
107 |
elif vk.__dict__.has_key(key): |
elif _VirtualKeys.__dict__.has_key(key): |
108 |
key = vk.__dict__[key] |
base = _VirtualKeys.__dict__[key] |
109 |
elif len(key) == 1: |
elif len(key) == 1: |
110 |
# TODO: This might not be necessary |
# TODO: This might not be necessary |
111 |
key = ord(key) |
key = ord(key) |
235 |
# |
# |
236 |
vk = _VirtualKeys() |
vk = _VirtualKeys() |
237 |
|
|
|
|
|
238 |
# |
# |
239 |
# Given a keycode value (e.g., -999), return |
# Given a keycode value (e.g., -999), return |
240 |
# the text representation as a string (e.g., 'F1') |
# the text representation as a string (e.g., 'F1') |