[SERVER-4611] Handle the AltGr key correctly in the shell (Windows) Created: 04/Jan/12  Updated: 11/Jul/16  Resolved: 04/Jan/12

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: None
Fix Version/s: 2.1.0

Type: Bug Priority: Major - P3
Reporter: Tad Marshall Assignee: Tad Marshall
Resolution: Done Votes: 0
Labels: Windows
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows, version 2.1.0-pre-


Issue Links:
Duplicate
Operating System: Windows
Participants:

 Description   

In Windows, the right Alt key is used as an AltGr key with international keyboard layouts, including English – United States International. In some keyboard layouts, certain normal ASCII characters need the AltGr key. For example, the Turkish Q keyboard layout uses AltGr+7 for '

{' (left wavy brace) and AltGr+0 for '}

' (right wavy brace). The shell is basically unusable with those keyboard layouts if the AltGr key is treated as a regular Alt key. My current code for handling Meta keys in the shell doesn't work with these international keyboard layouts. This issue was brought to my attention by a question on StackOverflow raised by a tester of our nightly builds.



 Comments   
Comment by auto [ 04/Jan/12 ]

Author:

{u'login': u'', u'name': u'Tad Marshall', u'email': u'tad@10gen.com'}

Message: SERVER-4611 handle AltGr correctly in Windows version of the shell

If a key's shift state indicates left-Ctrl and right-Alt are down, this
is a key pressed with AltGr, so ignore those two key state bits. The
character has already been interpreted by the keyboard layout and can
be used as-is.
Branch: master
https://github.com/mongodb/mongo/commit/8d2a8a6bd8a8bc6ac3102f907bf4cc5b2365eabd

Comment by Tad Marshall [ 04/Jan/12 ]

Here is the relevant StackOverflow discussion:

http://stackoverflow.com/questions/8695400
by: AnyOne

I am trying to use curly braces in mongodb native console client on Windows 7 but i am not able to write curly braces if i am even copy paste curly braces to console it just remove curly braces.

Which settings of console can cause this ?

Here is client console session

MongoDB shell version: 2.1.0-pr
connecting to: test
>

I am using 2.1.0 pre alpha version
--------
I have not seen this issue in 2.1.0-pre- . What language and keyboard layout are you using? Can you try a non-nightly release and see if it behaves the same? There is no special handling of left and right braces by the shell, they show up in input and are displayed on the screen in normal ASCII, but perhaps a non-English keyboard or display setting could affect them. – Tad Marshall
--------
Also, is this a version you downloaded or one you built yourself? If it is a downloaded nightly build, can you run mongod.exe and post the Git version (SHA-1) from the build, please? – Tad Marshall
--------
@TadMarshall - I downloaded it from MongoDB offical website in unstable nightly build secion and git version is "git version: 9c8dd2f5248c223a909f98b9c573bb112034c04d". I am using Turkish Q keyboard but i had not meet this problem on v2.0 – AnyOne
--------
Thanks for the info. Your build is almost identical to what I run, so I need to try setting a different keyboard. The Wikipedia article on keyboard layouts shows a Turkish Q keyboard ( en.wikipedia.org/wiki/Keyboard_layout#Turkish_.28Q-keyboard.29 ) and it looks like "

{" is AltGr+7 and "}

" is AltGr+0 ... is this right? So I should be able to get this effect on a US keyboard by setting Windows to use the Turkish Q layout, is that right? If I'm on the right track, I think I just need to respect the AltGr key and not treat it as Right Alt. Let me know, thanks! – Tad Marshall
--------
Yes, shortcuts are right. I think you should be get same effect on if you change layout to Turkish Q. – AnyOne

Generated at Thu Feb 08 03:06:29 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.