c/c++ function for keyboard layout

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • leejwen
    New Member
    • Jun 2007
    • 50

    c/c++ function for keyboard layout

    Hey guys.

    I'm really stuck on the keyboard problems. Is there any c/c++ functions, or methods :-), to know the physical layout of the keyboards. Thanks
  • oler1s
    Recognized Expert Contributor
    • Aug 2007
    • 671

    #2
    I could have sworn I answered your question. Did you delete your question and then repost it? If so, did you see my previous answer? I’m seriously asking the question.

    Comment

    • leejwen
      New Member
      • Jun 2007
      • 50

      #3
      Originally posted by oler1s
      I could have sworn I answered your question. Did you delete your question and then repost it? If so, did you see my previous answer? I’m seriously asking the question.
      I feel strange too. I did post a similar one, but it disappeared. I guess It could be I post it in wrong category. Could you please answer it again? Many thanks!

      Comment

      • oler1s
        Recognized Expert Contributor
        • Aug 2007
        • 671

        #4
        The answer is, neither C nor C++ itself has a concept of a keyboard. If you want to know about the current keyboard configuration or layout, you’ll have to look at what facilities the OS provides. All three major desktop platforms, Windows, Macs, and Linux, should have some sort of C API for determining the keyboard configuration.

        Comment

        • leejwen
          New Member
          • Jun 2007
          • 50

          #5
          Originally posted by oler1s
          The answer is, neither C nor C++ itself has a concept of a keyboard. If you want to know about the current keyboard configuration or layout, you’ll have to look at what facilities the OS provides. All three major desktop platforms, Windows, Macs, and Linux, should have some sort of C API for determining the keyboard configuration.
          My programming is based on Windows. It seems I can get the message of each key, althogh it cost lots of ''if else''. But again, what I really need is the physical layout, how do you know which key is near which key?

          Many thanks!

          Comment

          • oler1s
            Recognized Expert Contributor
            • Aug 2007
            • 671

            #6
            Oops, sorry for taking so long to respond.

            But again, what I really need is the physical layout, how do you know which key is near which key?
            I don’t believe you can find this information out. Keyboard layouts can vary quite a bit (see laptop keyboards), so trying to deduce what set of keys are near to each other, or even what keys are present, is a bad idea.

            Comment

            Working...