Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Capturing key presses with WinProc

Capturing key presses with WinProc

Scheduled Pinned Locked Moved C / C++ / MFC
jsonhelptutorialquestion
3 Posts 3 Posters 0 Views 1 Watching
  • 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.
  • C Offline
    C Offline
    Coremn
    wrote on last edited by
    #1

    I have an app that is controled using keypresses. Currently I use WinProc to capture the key presses and process them. My problem is non US layout keyboards. Example: If I wanted to test for a '?' key press on a US layout keyboard, I get a 'Shift' keypress and a '/' keypress. Most other international layouts do not have the '/' and '?' on the same key so this does not work. Is there anyway to capture a '?' or any other non-alphanumeric keys that require either shirt or alt to be presses. I.e returning the unicode of the key. Can this be done using windows API or should I be looking elsewhere? SDL or something?

    ---

    S T 2 Replies Last reply
    0
    • C Coremn

      I have an app that is controled using keypresses. Currently I use WinProc to capture the key presses and process them. My problem is non US layout keyboards. Example: If I wanted to test for a '?' key press on a US layout keyboard, I get a 'Shift' keypress and a '/' keypress. Most other international layouts do not have the '/' and '?' on the same key so this does not work. Is there anyway to capture a '?' or any other non-alphanumeric keys that require either shirt or alt to be presses. I.e returning the unicode of the key. Can this be done using windows API or should I be looking elsewhere? SDL or something?

      ---

      S Offline
      S Offline
      sunit5
      wrote on last edited by
      #2

      My suggesting is not to capture the key status because the different keyboard has differnt layout that why windows does TranslateMessage() for us .U put the ASCII value of the key in Switch case in WinProc

      never say die

      1 Reply Last reply
      0
      • C Coremn

        I have an app that is controled using keypresses. Currently I use WinProc to capture the key presses and process them. My problem is non US layout keyboards. Example: If I wanted to test for a '?' key press on a US layout keyboard, I get a 'Shift' keypress and a '/' keypress. Most other international layouts do not have the '/' and '?' on the same key so this does not work. Is there anyway to capture a '?' or any other non-alphanumeric keys that require either shirt or alt to be presses. I.e returning the unicode of the key. Can this be done using windows API or should I be looking elsewhere? SDL or something?

        ---

        T Offline
        T Offline
        ThatsAlok
        wrote on last edited by
        #3

        Coremn wrote:

        Example: If I wanted to test for a '?' key press on a US layout keyboard, I get a 'Shift' keypress and a '/' keypress. Most other international layouts do not have the '/' and '?' on the same key so this does not work.

        how are you comparing the returning key press!

        "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

        cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Re

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups