View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002135 | Far Manager | Keyboard | public | 2012-07-18 16:59 | 2012-09-20 09:40 |
Reporter | theultramage | Assigned To | 2useven10 | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | x64 | OS | Windows | OS Version | 7 |
Product Version | 3.0 | ||||
Fixed in Version | 3.0 | ||||
Summary | 0002135: typing 'shift + letter' diacritic sequence also outputs the + character | ||||
Description | When using the Slovak keyboard layout, it is possible to type characters with the ˇ (caron) diacritic by entering the sequence 'shift' '=' '<letter>'. Since last year, FAR also outputs the '+' character (which is what shift+= maps to on the US keyboard). This is undesirable. Note that strangely, the adjacent sequence 'shift -' for the ´ (acute) symbol does not have this issue. Listed in the 'additional information' section are versions I tested. That could help you narrow down the revision that caused the problem. | ||||
Steps To Reproduce | 1. Switch to Slovak keyboard layout. 2. Type the 'SHIFT =' combo, followed by, say, the letter 'c'. Expected output: č Observed output: +č | ||||
Additional Information | versions tested: Far-3.0.0.2098 (r6425) <- OK Far-3.0.0.2214 (r6757) <- bug Far-3.0.0.2627 (r7920) <- bug Far-3.0.0.2768 (r8261) <- bug | ||||
Tags | No tags attached. | ||||
Build | 2809 | ||||
|
Can't reproduce... Far3 2768 <- ok Far3 2772 <- ok Try to switch off plugins/macros 'far /p /m' |
|
Doing that, and deleting all plugins, and deleting my appdata/roaming profile has no impact on the bug. However, I noticed that I'm running slovak locale on an english language pack. When I switch to a different user that doesn't use the language pack, it works there just fine. When I find the time I'll do build&test runs on various revisions to pinpoint the revision where the behavior changed, and then identify the code that causes it. |
|
what is other programs (notepad, cmd.exe) behaviour ? |
|
Only FAR seems to be having this problem. Also note what I said at the beginning - when I run the older r6425 build, it works just fine. I'll try to find the true cause for you within the next 2 weeks. |
|
you can use nightly build archive to estimate first problem build. http://www.farmanager.com/nightly.php |
|
two weeks later... |
|
Heh, work+vacation, didn't have my vs2010 build environment to do the tests, and the builds inside the link you posted only go to december 2011 (which is several months too late). r6496 | skirda | 2011-08-01 13:47:15 +0200 Mantis#0001832 - http://bugs.farmanager.com/view.php?id=1832 |
|
The offending change is: + case VK_OEM_MINUS: + return '_'; + //return KEY_SHIFT|'-'; + case VK_OEM_PLUS: + return '+'; + //return KEY_SHIFT|'+'; The code was later changed to, which is apparently trying to do something... case VK_OEM_MINUS: return (Char>=' ')?Char:'_'; case VK_OEM_PLUS: return (Char>=' ')?Char:'+'; My current fix is: case VK_OEM_MINUS: return (Char>=' ')?Char:KEY_SHIFT|'-'; case VK_OEM_PLUS: return (Char>=' ')?Char:KEY_SHIFT|'='; (although I don't really know what I'm doing) |
|
Unfortunately I can't check that. Always have č only... |
|
similar problem (russian forum) http://forum.farmanager.com/viewtopic.php?f=9&t=7346 |
|
Umm, this is going to sound really stupid, but here's what I found while testing... 1) install sk win7 into virtualbox VM 2) install en LIP and switch interface to en 3) confirm that the bug is present 4) switch back to sk, then switch again to en 5) confirm that the bug is gone I'm not kidding, I re-ran steps 3-5 several times using an immutable disk image, and it's always the same - switching to sk fixes it, and it stays fixed when switching back to en. I don't understand. If needed I can re-test it from step 1. EDIT: confirmed on the laptop I originally reported this from. |
|
It is funny micracle soft. But anyway I think it should be fixed in farmanager. There is almost the same problem with sweden W8. Please keep bugly system environment to test possible fix[es]. (I hope from originators of 0001832). |
|
Please, provide output of KeyEvents utility http://code.google.com/p/conemu-maximus5/downloads/detail?name=KeyEvents4.7z You need to start it from Far, type sequence 'shift' '=' '<letter>' and attach output here. This issue does not reproduced on my PC, too. |
|
That is a pretty awesome tool! Here's the recording. It's the same for both the bugged and fixed VM state. Dn, Vk="VK_SHIFT" [ 16/0x0010], Scan=0x002A uChar=[U=' ' (0x0000): A=' ' (0x00)] Ctrl=0x10 Dn, Vk="VK_OEM_PLUS" [187/0x00BB], Scan=0x000D uChar=[U=' ' (0x0000): A=' ' (0x00)] Ctrl=0x10 Up, Vk="VK_OEM_PLUS" [187/0x00BB], Scan=0x0000 uChar=[U='' (0x02C7): A='ă' (0xC7)] Ctrl=0x10 Up, Vk="VK_OEM_PLUS" [187/0x00BB], Scan=0x000D uChar=[U='' (0x02C7): A='ă' (0xC7)] Ctrl=0x10 Up, Vk="VK_SHIFT" [ 16/0x0010], Scan=0x002A uChar=[U=' ' (0x0000): A=' ' (0x00)] Ctrl=0x00 Dn, Vk="VK_C" [ 67/0x0043], Scan=0x002E uChar=[U='' (0x010D): A=' ' (0x0D)] Ctrl=0x00 Up, Vk="VK_C" [ 67/0x0043], Scan=0x002E uChar=[U='c' (0x0063): A='c' (0x63)] Ctrl=0x00 |
|
Diacritic1.diff (3,992 bytes)
Index: keyboard.cpp =================================================================== --- keyboard.cpp (revision 8321) +++ keyboard.cpp (working copy) @@ -895,6 +895,8 @@ if (rec->EventType==KEY_EVENT) { + static bool bForceAltGr = false; + if (!rec->Event.KeyEvent.bKeyDown) { was_repeat = false; @@ -904,8 +906,21 @@ { was_repeat = (last_pressed_keycode == rec->Event.KeyEvent.wVirtualKeyCode); last_pressed_keycode = rec->Event.KeyEvent.wVirtualKeyCode; + + if (rec->Event.KeyEvent.wVirtualKeyCode == VK_MENU) + { + // ��������� � AltGr (��������� ����������) + bForceAltGr = (rec->Event.KeyEvent.wVirtualScanCode == 0) + && ((rec->Event.KeyEvent.dwControlKeyState & 0x1F) == 0x0A); + } } + if (bForceAltGr && (rec->Event.KeyEvent.dwControlKeyState & 0x1F) == 0x0A) + { + rec->Event.KeyEvent.dwControlKeyState &= ~LEFT_ALT_PRESSED; + rec->Event.KeyEvent.dwControlKeyState |= RIGHT_ALT_PRESSED; + } + DWORD CtrlState=rec->Event.KeyEvent.dwControlKeyState; //_SVS(if(rec->EventType==KEY_EVENT)SysLog(L"[%d] if(rec->EventType==KEY_EVENT) >>> %s",__LINE__,_INPUT_RECORD_Dump(rec))); @@ -2388,6 +2403,19 @@ { if (Char>=' ') return Char; + else if (RealKey && ScanCode && !Char && (KeyCode && KeyCode != VK_MENU)) + //��� ��������� �� ����� ������ ���� � �������, �������� � �����. + //������� �� �������� ���������, "AltGr+VK_OEM_1" ����� �� ������ ����������� �����, �.�. ��� DeadKey + //Dn, 1, Vk="VK_CONTROL" [17/0x0011], Scan=0x001D uChar=[U=' ' (0x0000): A=' ' (0x00)] Ctrl=0x00000008 (Casac - ecns) + //Dn, 1, Vk="VK_MENU" [18/0x0012], Scan=0x0038 uChar=[U=' ' (0x0000): A=' ' (0x00)] Ctrl=0x00000109 (CasAc - Ecns) + //Dn, 1, Vk="VK_OEM_1" [186/0x00BA], Scan=0x001B uChar=[U=' ' (0x0000): A=' ' (0x00)] Ctrl=0x00000009 (CasAc - ecns) + //Up, 1, Vk="VK_CONTROL" [17/0x0011], Scan=0x001D uChar=[U=' ' (0x0000): A=' ' (0x00)] Ctrl=0x00000001 (casAc - ecns) + //Up, 1, Vk="VK_MENU" [18/0x0012], Scan=0x0038 uChar=[U=' ' (0x0000): A=' ' (0x00)] Ctrl=0x00000100 (casac - Ecns) + //Up, 1, Vk="VK_OEM_1" [186/0x00BA], Scan=0x0000 uChar=[U='~' (0x007E): A='~' (0x7E)] Ctrl=0x00000000 (casac - ecns) + //Up, 1, Vk="VK_OEM_1" [186/0x00BA], Scan=0x001B uChar=[U='�' (0x00A8): A='' (0xA8)] Ctrl=0x00000000 (casac - ecns) + //Dn, 1, Vk="VK_A" [65/0x0041], Scan=0x001E uChar=[U='�' (0x00E3): A='' (0xE3)] Ctrl=0x00000000 (casac - ecns) + //Up, 1, Vk="VK_A" [65/0x0041], Scan=0x001E uChar=[U='a' (0x0061): A='a' (0x61)] Ctrl=0x00000000 (casac - ecns) + return KEY_NONE; else IntKeyState.CtrlPressed=0; } @@ -3216,6 +3244,22 @@ return ModifAlt|KeyCode; } + if (!IntKeyState.CtrlPressed && !IntKeyState.AltPressed && (KeyCode >= VK_OEM_1 && KeyCode <= VK_OEM_8) && !Char) + { + //��� ��������� �� ����, ���� ��� �� ���������� �� DeadKeys (����� �� ����� � Shift-��) + //������ ��������� �� ����� �������� � ����������� (����, �����, � ��.) + //Dn, Vk="VK_SHIFT" [ 16/0x0010], Scan=0x002A uChar=[U=' ' (0x0000): A=' ' (0x00)] Ctrl=0x10 + //Dn, Vk="VK_OEM_PLUS" [187/0x00BB], Scan=0x000D uChar=[U=' ' (0x0000): A=' ' (0x00)] Ctrl=0x10 + //Up, Vk="VK_OEM_PLUS" [187/0x00BB], Scan=0x0000 uChar=[U='' (0x02C7): A='?' (0xC7)] Ctrl=0x10 + //Up, Vk="VK_OEM_PLUS" [187/0x00BB], Scan=0x000D uChar=[U='' (0x02C7): A='?' (0xC7)] Ctrl=0x10 + //Up, Vk="VK_SHIFT" [ 16/0x0010], Scan=0x002A uChar=[U=' ' (0x0000): A=' ' (0x00)] Ctrl=0x00 + //Dn, Vk="VK_C" [ 67/0x0043], Scan=0x002E uChar=[U='' (0x010D): A=' ' (0x0D)] Ctrl=0x00 + //Up, Vk="VK_C" [ 67/0x0043], Scan=0x002E uChar=[U='c' (0x0063): A='c' (0x63)] Ctrl=0x00 + UINT uCalcChar=MapVirtualKey(KeyCode,MAPVK_VK_TO_CHAR); + if (!uCalcChar) + return KEY_NONE; + } + if (IntKeyState.ShiftPressed) { _SVS(if (KeyCode!=VK_SHIFT) SysLog(L"Shift -> |%s|%s|",_VK_KEY_ToName(KeyCode),_INPUT_RECORD_Dump(rec))); |
|
Patch implement sort of shamanism for dead keys. Hope, it's working. |
|
2794 (from Maximus) |
|
Made a clean far build, still happens there. Currently using the patch I mentioned in my 4th post to work around the issue. |
|
once more (I can't reproduce again)... http://forum.farmanager.com/viewtopic.php?f=37&t=7387 |
|
2 Maximus. Bug reproduced on my win7. English and Russian languages installed. Active language is English. Czech Qwerty keyboard layout added. |
|
2 Maximus MapVirtualKey() doesn't detect deadkey, so patch is useless here. What is wrong with theultramage fix ? It seems to work. And why KEY_SHIFT | ... combinations were replaced originally ? |
|
Well, I'll try to explain, what confuses me. This patch case VK_OEM_MINUS: return (Char>=' ')?Char:KEY_SHIFT|'-'; case VK_OEM_PLUS: return (Char>=' ')?Char:KEY_SHIFT|'='; takes into account only two keys. Much more keys may produce dead keys... And, I think, it must be return (Char>=' ')?KEY_NONE:... My patch - was a try to unify all keys, not just "+"/"-". We may try to replace UINT uCalcChar=MapVirtualKey(KeyCode,MAPVK_VK_TO_CHAR); if (!uCalcChar) return KEY_NONE; with just return KEY_NONE; May be, it will works? |
|
> And why KEY_SHIFT | ... combinations were replaced originally ? Just a cosmetic thing I believe, KEY_SHIFT|'-' == '_' and KEY_SHIFT|'=' == '+'. The author of the original r6496 edit used the compact version and left the expanded version as commented out lines (which was really confusing), and he made a typo in the commented line (more confusion). I thought it would be more readable if I used the expanded form since it shows the keys you actually have to press... but looking at it now, since the cases are VK_OEM_PLUS and VK_OEM_MINUS, maybe using + and - would make more sense. EDIT: never mind, I was wrong, KEY_SHIFT is not an ascii flag, it's a FAR-specific define with value 0x04000000 and special meaning. |
|
2809. both fixes here. maximus code works. |
|
Confirmed working on my win7 system + in vbox VM that also had the problem. Thank you for finding the time to reproduce and fix it. |
Date Modified | Username | Field | Change |
---|---|---|---|
2012-07-18 16:59 | theultramage | New Issue | |
2012-07-24 11:08 | 2useven10 | Note Added: 0009428 | |
2012-07-24 11:10 | 2useven10 | Note Edited: 0009428 | |
2012-07-25 13:14 | theultramage | Note Added: 0009437 | |
2012-07-25 13:36 | 2useven10 | Note Added: 0009438 | |
2012-07-25 13:38 | 2useven10 | Note Edited: 0009438 | |
2012-07-25 15:28 | theultramage | Note Added: 0009441 | |
2012-07-25 15:36 | 2useven10 | Note Added: 0009442 | |
2012-08-09 09:46 | 2useven10 | Note Added: 0009466 | |
2012-08-09 17:59 | theultramage | Note Added: 0009469 | |
2012-08-09 18:08 | theultramage | Note Added: 0009470 | |
2012-08-09 18:10 | theultramage | Note Edited: 0009470 | |
2012-08-09 18:10 | theultramage | Note Edited: 0009470 | |
2012-08-09 18:27 | theultramage | Note Edited: 0009470 | |
2012-08-09 18:32 | theultramage | Note Edited: 0009470 | |
2012-08-09 18:35 | theultramage | Note Edited: 0009470 | |
2012-08-10 12:15 | 2useven10 | Note Added: 0009471 | |
2012-08-15 10:41 | 2useven10 | Relationship added | related to 0001832 |
2012-08-15 10:43 | 2useven10 | Note Added: 0009481 | |
2012-08-15 21:16 | theultramage | Note Added: 0009482 | |
2012-08-15 21:26 | theultramage | Note Edited: 0009482 | |
2012-08-15 22:52 | 2useven10 | Note Added: 0009483 | |
2012-08-16 03:16 | 2useven10 | Note Edited: 0009483 | |
2012-08-16 20:43 | Maximus | Note Added: 0009487 | |
2012-08-16 23:47 | theultramage | Note Added: 0009491 | |
2012-08-16 23:49 | theultramage | Note Edited: 0009491 | |
2012-08-16 23:50 | theultramage | Note Edited: 0009491 | |
2012-08-16 23:51 | theultramage | Note Edited: 0009491 | |
2012-08-16 23:52 | theultramage | Note Edited: 0009491 | |
2012-08-16 23:53 | theultramage | Note Edited: 0009491 | |
2012-08-17 23:53 | Maximus | File Added: Diacritic1.diff | |
2012-08-17 23:54 | Maximus | Note Added: 0009492 | |
2012-09-05 13:20 | 2useven10 | Note Added: 0009502 | |
2012-09-05 13:20 | 2useven10 | Assigned To | => 2useven10 |
2012-09-05 13:20 | 2useven10 | Status | new => feedback |
2012-09-05 14:31 | theultramage | Note Added: 0009503 | |
2012-09-05 14:31 | theultramage | Status | feedback => assigned |
2012-09-13 19:26 | 2useven10 | Note Added: 0009516 | |
2012-09-18 19:17 | 2useven10 | Note Added: 0009523 | |
2012-09-19 07:30 | 2useven10 | Note Added: 0009524 | |
2012-09-19 07:36 | 2useven10 | Note Edited: 0009524 | |
2012-09-19 08:32 | Maximus | Note Added: 0009525 | |
2012-09-19 10:00 | theultramage | Note Added: 0009526 | |
2012-09-19 10:00 | theultramage | Note Edited: 0009526 | |
2012-09-19 10:43 | 2useven10 | Note Added: 0009527 | |
2012-09-19 10:43 | 2useven10 | Status | assigned => feedback |
2012-09-19 15:01 | theultramage | Note Edited: 0009526 | |
2012-09-19 15:10 | theultramage | Note Added: 0009528 | |
2012-09-19 15:10 | theultramage | Status | feedback => assigned |
2012-09-20 09:40 | 2useven10 | Build | => 2809 |
2012-09-20 09:40 | 2useven10 | Status | assigned => closed |
2012-09-20 09:40 | 2useven10 | Resolution | open => fixed |
2012-09-20 09:40 | 2useven10 | Fixed in Version | => 3.0 |