diff --git a/twander.py b/twander.py index dbe64a4..b663bd0 100755 --- a/twander.py +++ b/twander.py @@ -4,7 +4,7 @@ # For Updates See: http://www.tundraware.com/Software/twander PROGNAME = "twander" -RCSID = "$Id: twander.py,v 2.50 2003/01/11 00:23:48 tundra Exp $" +RCSID = "$Id: twander.py,v 2.51 2003/01/11 07:41:07 tundra Exp $" VERSION = RCSID.split()[2] @@ -1066,7 +1066,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(event, index)) + self.DirList.bind('' % (x+1), lambda event, index=x :FuncKeypress(index)) # Give the listbox focus so it gets keystrokes @@ -1243,6 +1243,12 @@ def MouseClick(event): + # Some Win32 systems always set Mod1 as well as Alt + # Get rid of this bit, so it doesn't pester us. + + if OSNAME == 'nt': + event.state = event.state & ~Mod1Mask + if event.state == Button3Mask: # Button-3 / No Modifier x, y = UI.DirList.winfo_pointerxy() # Position near mouse CommandMenu(event, x, y) # Display Context Menu @@ -1260,6 +1266,12 @@ def MouseDblClick(event): + # Some Win32 systems always set Mod1 as well as Alt + # Get rid of this bit, so it doesn't pester us. + + if OSNAME == 'nt': + event.state = event.state & ~Mod1Mask + if event.state == Button1Mask: # Double-Button-2 / No Modifier DirListHandler(event) # Execute selected item @@ -1311,6 +1323,12 @@ def KeystrokeHandler(event): + # Some Win32 systems always set Mod1 as well as Alt + # Get rid of this bit, so it doesn't pester us. + + if OSNAME == 'nt': + event.state = event.state & ~Mod1Mask + # Check for, and handle accelerator keys if event.state == AltMask: @@ -1775,7 +1793,8 @@ # get "/". In the case of Win32, we will get # "DRIVE:/". - selected += PSEP + if selected[-1] != PSEP: + selected += PSEP # Load UI with new directory LoadDirList(selected, save=TRUE) @@ -1812,7 +1831,7 @@ # Event Handler: Handler Function Keys ##### -def FuncKeypress(event, index): +def FuncKeypress(index): dir = UI.FuncKeys[index] if dir: