Author: reinhard
Date: 2007-04-25 15:37:25 -0500 (Wed, 25 Apr 2007)
New Revision: 9523
Modified:
trunk/gnue-forms/src/input/GFKeyMapper.py
Log:
Removed some more obsolete and meanwhile unused stuff.
Modified: trunk/gnue-forms/src/input/GFKeyMapper.py
===================================================================
--- trunk/gnue-forms/src/input/GFKeyMapper.py 2007-04-25 20:26:25 UTC (rev 9522)
+++ trunk/gnue-forms/src/input/GFKeyMapper.py 2007-04-25 20:37:25 UTC (rev 9523)
@@ -60,15 +60,6 @@
self.__keyTranslations = {}
- def getKeyTranslation (self, aKey):
- """
- Return the actual key for a given vk.* constant, as it will be used by the
- UI driver.
- """
-
- return self.__keyTranslations.get (aKey)
-
-
def setUIKeyMap(self, keyset):
"""
Called by the UI class to setup their required key mappings.
@@ -170,56 +161,6 @@
self.setUserKeyMap(usermap)
- #
- # Return the (virtual) keystroke assigned to
- # a given event. (e.g., if event = 'PREVBLOCK'
- # then return vk.PAGEUP)
- #
- def getEventKeystroke(self, event):
- for key in self.__functionMap.keys():
- if self.__functionMap[key] == event:
- return key
- return None
-
-
- # ---------------------------------------------------------------------------
- # Return a keystroke assigned to a given event using the UI keymap
- # ---------------------------------------------------------------------------
-
- def getUIEventKeyStroke (self, event):
- for (key, value) in self._translatedUserKeyMap.items ():
- if value == event and key [0] >= 0:
- return key
- return None
-
-
- #
- # Same as getEventKeystroke except that
- # a text representation is return ('F1')
- # instead of the numerical code. Useful
- # for building "Menus" or "Help Screens"
- #
- def getEventKeystrokeRepr(self, event, metamappings={}, separator="+"):
- keystroke = self.getEventKeystroke(event)
-
- if keystroke is None:
- return None
-
- base, shifted, ctrl, meta = keystroke
- rv = ""
- if ctrl:
- rv += metamappings.get("CONTROL","Ctrl") + separator
- if meta:
- rv += metamappings.get("META","Alt") + separator
- if shifted:
- rv += metamappings.get("SHIFT","Shift") + separator
-
- v = reverseLookup(base)
-
- return "%s%s" % (rv, metamappings.get(v, v))
-
-
-
def getEvent(self, basekey, shift=False, ctrl=False, meta=False):
"""
If an event is assigned to the specified keystroke then return
@@ -313,31 +254,6 @@
#
vk = _VirtualKeys()
-
-#
-# Given a keycode value (e.g., -999), return
-# the text representation as a string (e.g., 'F1')
-#
-def reverseLookup(keyvalue):
- """
- Given a keycode value (e.g., -999), return
- the text representation as a string (e.g., 'F1')
- """
-
- # This is done for efficiency of real-time lookups;
- # i.e., we don't often do reverseLookups, but a
- # regular lookup must happen as efficiently as
- # possible as a lookup happens each time a key is
- # pressed!
-
- for key in dir(vk):
- if getattr(vk, key) == keyvalue:
- return key
- if keyvalue >= 0 and keyvalue <= 255:
- return chr (keyvalue).upper()
- return None
-
-
# =============================================================================
# Default key to command event mappings
# =============================================================================
@@ -379,7 +295,6 @@
(vk.DOWN, False, False, False) : 'NEXTRECORD',
(vk.UP, False, True, False) : 'FIRSTRECORD',
(vk.DOWN, False, True, False) : 'LASTRECORD',
-# (vk.F2, False, False, False) : 'ENTEREDIT',
(vk.F3, False, False, False) : 'JUMPPROMPT',
(vk.F5, False, False, False) : 'MARKFORDELETE',
(vk.F6, False, False, False) : 'COMMIT',
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.