Intercept mouse event and change to different event

This is a discussion on Intercept mouse event and change to different event within the Windows Programming forums, part of the Platform Specific Boards category; Hello All, Using C#, I would like to write a program that will run in the background (possibly minimizing to ...

  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,046
    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, 10: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, 09: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, 12:38 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21