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. KeyDown

KeyDown

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
4 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.
  • S Offline
    S Offline
    sheetal_06
    wrote on last edited by
    #1

    How to detect which key has been pressed along with ctrl key? Thankyou

    N H 2 Replies Last reply
    0
    • S sheetal_06

      How to detect which key has been pressed along with ctrl key? Thankyou

      N Offline
      N Offline
      Nibu babu thomas
      wrote on last edited by
      #2

      Use GetKeyState to find out state of control key...

      BOOL SomeDialog::PreTranslateMessage(MSG* pMsg)
      {
      if( pMsg->message == WM_KEYDOWN &&
      pMsg->wParam == VK_TAB &&
      ( GetKeyState( VK_CONTROL ) & 0x8000 )
      )
      {
      HandleCtrlTab();
      return TRUE;
      }
      return CDialog::PreTranslateMessage(pMsg);
      }


      Nibu thomas A Developer Code must be written to be read, not by the compiler, but by another human being. http:\\nibuthomas.wordpress.com

      S 1 Reply Last reply
      0
      • N Nibu babu thomas

        Use GetKeyState to find out state of control key...

        BOOL SomeDialog::PreTranslateMessage(MSG* pMsg)
        {
        if( pMsg->message == WM_KEYDOWN &&
        pMsg->wParam == VK_TAB &&
        ( GetKeyState( VK_CONTROL ) & 0x8000 )
        )
        {
        HandleCtrlTab();
        return TRUE;
        }
        return CDialog::PreTranslateMessage(pMsg);
        }


        Nibu thomas A Developer Code must be written to be read, not by the compiler, but by another human being. http:\\nibuthomas.wordpress.com

        S Offline
        S Offline
        sheetal_06
        wrote on last edited by
        #3

        Thankyou very much...

        1 Reply Last reply
        0
        • S sheetal_06

          How to detect which key has been pressed along with ctrl key? Thankyou

          H Offline
          H Offline
          Hamid Taebi
          wrote on last edited by
          #4

          And see Onscreen Keyboard[^] an example of a keyboard.:)


          WhiteSky


          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