Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusion between ² and ' keys on AZERTY (french) keyboard for Macro Shortcuts #864

Open
cbouc opened this issue Aug 13, 2024 · 6 comments
Labels

Comments

@cbouc
Copy link

cbouc commented Aug 13, 2024

Far Manager version

3.0.6300.0 x64

OS version

10.0.22631.3880

Other software

No response

Steps to reproduce

On an AZERTY keyboard (yes, I know, make the matter difficult), there's a ² (U+00B2 Superscript two) key right under the Escape key and I use it to run a macro, everything was ok until I upgraded FAR to recent version (sorry, don't know the old version).
Pressing Ctrl+Shift+. twice (empty macro, not important) and trying to enter ² in the "Press the desired key" dialog result in a ' (U+0027 Apostrophe) instead of ². Then, both the ² and ' keys activate the macro!
Very bad as ' is often required in command lines!
Trying to fix the recorded macro to replace ' shortcut with ² doesn't work, pressing ² doesn't activates the macro.
I can investigate the problem (debug) if I have some guidance (where to look in the sources to put breakpoints).
Still, without macro associated to ', pressing ² or ' produce the expected character (no confusion in command line nor editor, it seem to be a problem with macro shortcuts alone)!

Expected behavior

Macro shortcuts detection distinguish ² from ' !!!

Actual behavior

Macro shortcut detection confuse ' and ²

@cbouc cbouc added the bug label Aug 13, 2024
@alabuzhev
Copy link
Contributor

@cbouc I cannot reproduce the issue with the latest available version (assuming that by AZERTY you mean French keyboard layout).

Please try to upgrade: https://github.com/FarGroup/FarManager/releases

@cbouc
Copy link
Author

cbouc commented Aug 14, 2024

It's even worse: not only I still have the bug, but now, instead of starting/finishing macro recording with Ctrl+Shift+. (because . is Shift+; on AZERTY, it worked that way until 3.0.6300.0), now it's Ctrl+Shift+/ (/ being Shift+: with AZERTY keyboard, the . key in QWERTY being the / key in AZERTY, I think the key code is checked instead of the associated character on the keyboard).

INFO: key (upper left one below Escape, pressed without any modifier key) that produces the ² in AZERTY produces a ` (backquote) in QWERTY (doesn't really explain the problem as I get a quote in AZERTY).

Made the test without ConEmu to ensure it wasn't the source of the problem.

Screenshot after finishing recording a macro and pressing the ² (AZERTY) key, I still have a ' (latest FAR version as recommended).

FarBug

@cbouc
Copy link
Author

cbouc commented Aug 14, 2024

Really sorry, I just found that the bug appeared only in Remote Desktop use! Tried on my local machine, it doesn't happen!
Using AZERTY keyboard both on local and remote computers.
I did record keyboard messages with Spy++x64 on both the local and remote computers (using a local Spy++ on each one), the content of the messages when pressing the ² is EXACTLY the same on both sides (except of course the windows' handles), very strange!
FarBug2

@alabuzhev
Copy link
Contributor

I think the key code is checked instead of the associated character on the keyboard)

In a way, yes: VK_OEM_* keys are mapped to completely different actions on various national keyboards and it is a pain if you have multiple keyboard layouts installed, so for macros we map such keys to the US keyboard if nothing else works, which might be not what is written on the keys, but at least it is consistent.

the bug appeared only in Remote Desktop use

When we map the keys, we try to take keyboard layouts into account. This generally works as expected locally, but in remote sessions we get server layouts, which are not necessarily the same, so things might get worse.

I can reproduce ² -> ' now (I was doing it wrong), will try to improve the situation.
Do you still have issues with other keys locally (let's ignore RDP for now)?

@cbouc
Copy link
Author

cbouc commented Aug 14, 2024

Thank you for the quick answers!
Ctrl+: instead of Ctrl+. to start/stop macro recording (still AZERTY but RDP not required, I wrote Ctrl+Shift+/ previously but Ctrl+: works too, and / is Shift+:), but this is by far (!) not as anoying as the ² key. ² is very good to open a custom menu because I almost never use it for entering the character and it doesn't need modifier(s). Ctrl+: is as easy to use as Ctrl+.

@alabuzhev
Copy link
Contributor

I've made a few experimental changes, ² should work in 6359.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants