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#
  4. Problem with the OnKeyDown event...

Problem with the OnKeyDown event...

Scheduled Pinned Locked Moved C#
helptutorialquestion
5 Posts 4 Posters 1 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.
  • G Offline
    G Offline
    Georgi Atanasov
    wrote on last edited by
    #1

    Hi, I experienced a strange problem - I am currently building an application that has a user control in it and for this control I want to trap the pressing of the ARROWS keys. BUT... The problem is that only the OnKeyUp event occurs for THOSE KEYS - this is not what I need :(( I tried overriding the ProcessKeyMessage method and found out that the control actually is not RECEIVING the WM_KEYDOWN message for the ARROW keys! Any idea how to solve this problem? Thanks, Georgi

    B V 2 Replies Last reply
    0
    • G Georgi Atanasov

      Hi, I experienced a strange problem - I am currently building an application that has a user control in it and for this control I want to trap the pressing of the ARROWS keys. BUT... The problem is that only the OnKeyUp event occurs for THOSE KEYS - this is not what I need :(( I tried overriding the ProcessKeyMessage method and found out that the control actually is not RECEIVING the WM_KEYDOWN message for the ARROW keys! Any idea how to solve this problem? Thanks, Georgi

      B Offline
      B Offline
      Bo Hunter
      wrote on last edited by
      #2

      I dont understand, on my machine both the keyup and keydown events are fired. Bo Hunter

      A 1 Reply Last reply
      0
      • B Bo Hunter

        I dont understand, on my machine both the keyup and keydown events are fired. Bo Hunter

        A Offline
        A Offline
        A Wegierski
        wrote on last edited by
        #3

        I had thesame trouble, try to check another methods containing "key" in their names. I override ProcessKeyPreview and ProcessDialogKey in similar case. Or use KeyUp() ... Hi, AW

        V 1 Reply Last reply
        0
        • A A Wegierski

          I had thesame trouble, try to check another methods containing "key" in their names. I override ProcessKeyPreview and ProcessDialogKey in similar case. Or use KeyUp() ... Hi, AW

          V Offline
          V Offline
          Valeria Bogdevich
          wrote on last edited by
          #4

          All that you have to do is to override IsInputKey and then you'll be able to process key in OnKeyDown method


          "...hasn't really been well accepted ... as the ratings tell us so far :)" - Nishant S

          1 Reply Last reply
          0
          • G Georgi Atanasov

            Hi, I experienced a strange problem - I am currently building an application that has a user control in it and for this control I want to trap the pressing of the ARROWS keys. BUT... The problem is that only the OnKeyUp event occurs for THOSE KEYS - this is not what I need :(( I tried overriding the ProcessKeyMessage method and found out that the control actually is not RECEIVING the WM_KEYDOWN message for the ARROW keys! Any idea how to solve this problem? Thanks, Georgi

            V Offline
            V Offline
            Valeria Bogdevich
            wrote on last edited by
            #5

            All that you have to do is to override IsInputKey and then you'll be able to process key in OnKeyDown method


            "...hasn't really been well accepted ... as the ratings tell us so far :)" - Nishant S

            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