Changing drive letter causes odd behaviour

You have encountered a problem using Far Manager? Here you can get help.
Groucho2004
Posts: 7
Joined: Sat 11 Dec, 2010 00:04

Changing drive letter causes odd behaviour

Postby Groucho2004 » Tue 14 Jul, 2015 18:03

I usually change the drive in the FAR panels by typing the drive letter, colon and Enter. For me this is faster than using Alt-F1/F2 and selecting the drive, especially with a long drive list. I also type the sequence very fast, I suppose.
Recently I updated from r3800 to r4400 and I noticed that instead of changing the drive, FAR opens an Explorer window (???). When I type the sequence slowly, this doesn't happen and FAR changes the drive.
Any ideas which change in the code caused this behaviour?

User avatar
HaRT
Moderator
Posts: 7955
Joined: Tue 30 Aug, 2005 17:21
Location: Санкт-Петербург
Has thanked: 66 times
Been thanked: 97 times

Changing drive letter causes odd behaviour

Postby HaRT » Tue 14 Jul, 2015 18:05

Probably you hit Enter before releasing Shift from the colon. ShiftEnter is exactly “run by Explorer”. ;)
BTW, why not use, say, AltF1 Q — it's 3 key-presses instead of your 4.
Фар есть инструмент, а не нянька. © 2009 DrKnS

Groucho2004
Posts: 7
Joined: Sat 11 Dec, 2010 00:04

Changing drive letter causes odd behaviour

Postby Groucho2004 » Tue 14 Jul, 2015 23:38

HaRT wrote:Probably you hit Enter before releasing Shift from the colon. ShiftEnter is exactly “run by Explorer”. ;)
But why does it not happen with r3800 (or any earlier versions)? I think some code that processes the key states has changed.

User avatar
HaRT
Moderator
Posts: 7955
Joined: Tue 30 Aug, 2005 17:21
Location: Санкт-Петербург
Has thanked: 66 times
Been thanked: 97 times

Changing drive letter causes odd behaviour

Postby HaRT » Wed 15 Jul, 2015 00:38

Groucho2004 wrote:But why does it not happen with r3800 (or any earlier versions)?
I recollect there were changes a few months ago regarding how key presses and releases are handled. I think you might find more details in the changelog.
Фар есть инструмент, а не нянька. © 2009 DrKnS

Groucho2004
Posts: 7
Joined: Sat 11 Dec, 2010 00:04

Changing drive letter causes odd behaviour

Postby Groucho2004 » Wed 15 Jul, 2015 15:53

Found it in keyboard.cpp:

r3800:

Code: Select all

   switch (KeyCode)
   {
      case VK_RETURN:
         if (IntKeyState.ShiftPressed && RealKey && !ShiftPressedLast && !IntKeyState.CtrlPressed && !IntKeyState.AltPressed && !LastShiftEnterPressed)
            return (CtrlState&ENHANCED_KEY)?KEY_NUMENTER:KEY_ENTER;

         LastShiftEnterPressed = (Modif&KEY_SHIFT) != 0;
         return Modif|((CtrlState&ENHANCED_KEY)?KEY_NUMENTER:KEY_ENTER);


r4400:

Code: Select all

   switch (KeyCode)
   {
      case VK_RETURN:
         LastShiftEnterPressed = (Modif&KEY_SHIFT) != 0;
         return Modif|((CtrlState&ENHANCED_KEY)?KEY_NUMENTER:KEY_ENTER);

When I add the condition from r3800, r4400 works as I want. Of course I don't know what I might break with this. :D


Return to “Support and Troubleshooting”

Who is online

Users browsing this forum: No registered users and 2 guests