Thread: Intercept mouse event and change to different event

  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    1

    Intercept mouse event and change to different event

    Hello All,

    Using C#, I would like to write a program that will run in the background (possibly minimizing to the taskbar or even run as a service), that would allow me to me intercept a mouse click, and change it from a left click to a right click if a certain key combination is pressed down, say ctrl + alt.

    Could someone give me some info on how to get started, which packages to use, examples.. etc?

    I would greatly appreciate it. Also, I tired using the search to find this info, but since I am not familiar with this domain, my search returned so many results with nothing specific to what I'm looking for, so, if someone knows there are threads discussing this topic already, it would be great if they could post a few links in here.

    Thanks!

  2. #2
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    Seems to me that you could trap the mouse, determine which modifier keys were pressed, and then generate the mouse event of your choosing.

    BTW, I found all of this information on Google very easily by googling for "c# catch mouse", "c# determine shift modifier", and "c# generate mouse event", respectively.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Mouse Events
    By disruptor108 in forum C# Programming
    Replies: 0
    Last Post: 01-23-2007, 11:40 PM
  2. How to do a mouse over event on a button?
    By GUIPenguin in forum C# Programming
    Replies: 1
    Last Post: 07-06-2006, 10:34 AM
  3. Replies: 11
    Last Post: 10-24-2004, 10:28 AM
  4. windows time change event
    By Nate in forum Windows Programming
    Replies: 5
    Last Post: 11-19-2002, 10:53 AM
  5. Mouse in 800x600 24Bit Mode?
    By Unregistered in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 11-11-2001, 01:38 AM