Changing drive letter causes odd behaviour

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

Changing drive letter causes odd behaviour

Post by Groucho2004 »

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: 10823
Joined: Tue 30 Aug, 2005 17:21
Has thanked: 221 times
Been thanked: 358 times

Changing drive letter causes odd behaviour

Post by HaRT »

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

Post by Groucho2004 »

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: 10823
Joined: Tue 30 Aug, 2005 17:21
Has thanked: 221 times
Been thanked: 358 times

Changing drive letter causes odd behaviour

Post by HaRT »

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

Post by Groucho2004 »

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
Post Reply

Return to “Support and Troubleshooting”