diff --git a/twander.py b/twander.py index 657888b..fb8aa86 100755 --- a/twander.py +++ b/twander.py @@ -6,7 +6,7 @@ # Program Information PROGNAME = "twander" -RCSID = "$Id: twander.py,v 2.88 2003/01/31 19:01:05 tundra Exp $" +RCSID = "$Id: twander.py,v 2.89 2003/01/31 23:08:14 tundra Exp $" VERSION = RCSID.split()[2] # Copyright Information @@ -1357,7 +1357,7 @@ # Bind function keys to a common handler for x in range(len(self.FuncKeys)): - self.DirList.bind('' % (x+1), lambda event, index=x :FuncKeypress(index)) + self.DirList.bind('' % (x+1), lambda event, index=x :FuncKeypress(event, index)) # Give the listbox focus so it gets keystrokes @@ -2142,8 +2142,18 @@ # Event Handler: Handler Function Keys ##### -def FuncKeypress(index): +def FuncKeypress(event, index): + # Only simple Function Key presses are accepted + # Modification by Ctl, Alt, etc. are ignored. + # This means event.state should be 0 after we + # mask off the "don't care" bits + + if (event.state & ~DontCareMask): + return "break" + + # Process the keypress + dir = UI.FuncKeys[index] if dir: LoadDirList(dir)