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 and mouse

keyboard and mouse

Scheduled Pinned Locked Moved C#
helpquestion
4 Posts 4 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.
  • X Offline
    X Offline
    xkx32
    wrote on last edited by
    #1

    Hello, I'm wondering how it's possible to create an application wide event that's fired when any keyboard or mouse key is pressed and mouse move? Please help. Thanks

    A B E 3 Replies Last reply
    0
    • X xkx32

      Hello, I'm wondering how it's possible to create an application wide event that's fired when any keyboard or mouse key is pressed and mouse move? Please help. Thanks

      A Offline
      A Offline
      Andy Moore
      wrote on last edited by
      #2

      Look at the KeyPress and MouseMove events in the System.Windows.Forms namespace.

      Deus caritas est

      1 Reply Last reply
      0
      • X xkx32

        Hello, I'm wondering how it's possible to create an application wide event that's fired when any keyboard or mouse key is pressed and mouse move? Please help. Thanks

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

        Hi There are usually two ways to handle user inputs (keyboard/mouse). If you like to hanlde those events in a form you can turn its keypreview property to true and override its OnKeyDown,OnKeyUp,OnMouseDown and etc. metohds to do what you want to do (or you can add a handler using event handlers) But if you like to handle those events in an application rather than a form you can handle messages that are being send to your application by windows. Regards

        1 Reply Last reply
        0
        • X xkx32

          Hello, I'm wondering how it's possible to create an application wide event that's fired when any keyboard or mouse key is pressed and mouse move? Please help. Thanks

          E Offline
          E Offline
          Ed Poore
          wrote on last edited by
          #4

          If you want system-wide event notification then you'll have to have a Windows hook me thinks.  There is an article on System-wide keyboard hooks here on CP, can't remember what it's called but search for "system wide hotkey" and you should find it.


          As of how to accomplish this, have you ever tried Google?

          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