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. Keyboard key pressed

Keyboard key pressed

Scheduled Pinned Locked Moved C#
questioncomannouncement
6 Posts 3 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.
  • B Offline
    B Offline
    BLaZiNiX
    wrote on last edited by
    #1

    I have a special keyboard with some special button at the top of the F.. button like (Banking,My Site,Shopping,Volume Up,Volume Down) and things like that. And this keyboard came with the computer (E-Machine) and those special button works only with the Windows 98 version that came with the computer, now i'm on XP (and you can figure that those buttons don't works) and I want to know how can I create a program that I will put in the tray or maybe a service that can detect when I'm pressing the selected button on the keyboard and add an action to it like Process.Start("http://www.google.com"); on the My Site Button. Any suggestion ?? Thanks

    N 1 Reply Last reply
    0
    • B BLaZiNiX

      I have a special keyboard with some special button at the top of the F.. button like (Banking,My Site,Shopping,Volume Up,Volume Down) and things like that. And this keyboard came with the computer (E-Machine) and those special button works only with the Windows 98 version that came with the computer, now i'm on XP (and you can figure that those buttons don't works) and I want to know how can I create a program that I will put in the tray or maybe a service that can detect when I'm pressing the selected button on the keyboard and add an action to it like Process.Start("http://www.google.com"); on the My Site Button. Any suggestion ?? Thanks

      N Offline
      N Offline
      Nick Parker
      wrote on last edited by
      #2

      You could begin by overriding the WndProc method and watch to see the message you send when pressing those special buttons, if at all. You could also try to override the onKeyPress method as well to see if you get a reaction from Windows. No guarantees here though as I am not exactly sure this would work, just a thought. :) Nick Parker

      B 1 Reply Last reply
      0
      • N Nick Parker

        You could begin by overriding the WndProc method and watch to see the message you send when pressing those special buttons, if at all. You could also try to override the onKeyPress method as well to see if you get a reaction from Windows. No guarantees here though as I am not exactly sure this would work, just a thought. :) Nick Parker

        B Offline
        B Offline
        BLaZiNiX
        wrote on last edited by
        #3

        k and how can i override the WndProc, do u have an example please ??

        J 1 Reply Last reply
        0
        • B BLaZiNiX

          k and how can i override the WndProc, do u have an example please ??

          J Offline
          J Offline
          James T Johnson
          wrote on last edited by
          #4

          protected override void WndProc(ref Message m)
          {
          // Handle messages, if you don't want to use the base
          // implementation return before finishing
          switch(m.Message)
          {
          .....
          }

          base.WndProc(ref m);
          }

          [Edit: The value to use for the case statment can be found in the Windows SDK; best thing you can do is use the "Find in Files" feature and point it at the PlatformSDK/include directory] HTH, James

          B N 2 Replies Last reply
          0
          • J James T Johnson

            protected override void WndProc(ref Message m)
            {
            // Handle messages, if you don't want to use the base
            // implementation return before finishing
            switch(m.Message)
            {
            .....
            }

            base.WndProc(ref m);
            }

            [Edit: The value to use for the case statment can be found in the Windows SDK; best thing you can do is use the "Find in Files" feature and point it at the PlatformSDK/include directory] HTH, James

            B Offline
            B Offline
            BLaZiNiX
            wrote on last edited by
            #5

            hi, i tried to override it using the WM_KEYDOWN like in VC++ but no result, i test my sample app with a listbox so when i'm clicking a key i'm suppose to get his value but no result and something strange it's that i tried to make the same thing but using the OnKeyPressed an no result too , that's strange ... Can you show me the way to do it please ? Thanks a lot James :)

            1 Reply Last reply
            0
            • J James T Johnson

              protected override void WndProc(ref Message m)
              {
              // Handle messages, if you don't want to use the base
              // implementation return before finishing
              switch(m.Message)
              {
              .....
              }

              base.WndProc(ref m);
              }

              [Edit: The value to use for the case statment can be found in the Windows SDK; best thing you can do is use the "Find in Files" feature and point it at the PlatformSDK/include directory] HTH, James

              N Offline
              N Offline
              Nick Parker
              wrote on last edited by
              #6

              Thanks James, I just got into work and got the response from BLaZiNiX, you just beat me to it. :-D Nick Parker

              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