Community
    • Login

    How to differentiate ctrl and alt gr

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    9 Posts 4 Posters 4.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Aadarsh IndurkhyaA
      Aadarsh Indurkhya
      last edited by

      Hi,

      I am facing an issue regarding differentiating ctrl and altgr key strokes.
      https://support.microsoft.com/en-us/kb/306560

      Following this link i changed my keyboard layout to US international which converts my right alt key to behave as altgr key.

      But my code is currently not able to distinguish between altgr and control key since it is receiving the same messages. In notepad++ it is working fine. Can you please help me with distinguishing these two control messages.

      I m using VK_CONTROL to check for control key press

      Thanks

      Claudia FrankC 1 Reply Last reply Reply Quote 0
      • Claudia FrankC
        Claudia Frank @Aadarsh Indurkhya
        last edited by

        @Aadarsh-Indurkhya

        maybe this helps.

        Cheers
        Claudia

        Scott SumnerS Jim DaileyJ 2 Replies Last reply Reply Quote 3
        • Scott SumnerS
          Scott Sumner @Claudia Frank
          last edited by

          @Claudia-Frank

          You are on fire with the LMGTFY answers!
          I hope I never get one of those answers from you. :-)

          Claudia FrankC 1 Reply Last reply Reply Quote 0
          • Claudia FrankC
            Claudia Frank @Scott Sumner
            last edited by

            Scott,
            I hope there is no service like
            let_me_correct_your_answer_by_google
            otherwise I think the boomerang will hit me. ;-)

            Cheers
            Claudia

            1 Reply Last reply Reply Quote 0
            • Jim DaileyJ
              Jim Dailey @Claudia Frank
              last edited by

              @Claudia-Frank
              Wicked sweet answer! I am amazed at how many people apparently never think of doing even a simple web search.

              Claudia FrankC 1 Reply Last reply Reply Quote 0
              • Claudia FrankC
                Claudia Frank @Jim Dailey
                last edited by

                @Jim-Dailey
                ;-) but how did they find this forum?
                There must be a place somewhere pointing to it, with some comment like
                What you always wanted to know - ask there. ;-D
                I need to check google maps - should be easy to find this information sign ;-)

                Cheers
                Claudia

                1 Reply Last reply Reply Quote 0
                • Aadarsh IndurkhyaA
                  Aadarsh Indurkhya
                  last edited by

                  can you point it in code how it is handled in notepad++ ( just the filename in the source code will help ) . Because i found out that this is sending 2 control messages successively : one for control ( VK_CONTROL ) and one for alt ( VK_MENU ) One possible solution i can think of is to note the last control message and check the current control message to check whether they are of alt-gr sequence. But i believe a better solution might exist .

                  Regards
                  Aadarsh

                  1 Reply Last reply Reply Quote 0
                  • Aadarsh IndurkhyaA
                    Aadarsh Indurkhya
                    last edited by

                    I solved the issue with GetKeyState method to check the current state of alt key. if you have any other solution please share :)

                    p.s : I found this forum via notepad++ git repo.

                    1 Reply Last reply Reply Quote 0
                    • Claudia FrankC
                      Claudia Frank
                      last edited by Claudia Frank

                      @Aadarsh-Indurkhya

                      GetKeyState is the one I would have used as well, I guess.
                      Why do you think npp is checking for AltGr?
                      I assume it isn’t.

                      p.s : I found this forum via notepad++ git repo.

                      That’s a good one ;-)

                      Cheers
                      Claudia

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post
                      The Community of users of the Notepad++ text editor.
                      Powered by NodeBB | Contributors