Jump to content

Inverting mouse clicks


Recommended Posts

I was wondering if there was some way to switch the mouse clicks. I know you can do this my going to Start > Control Panel > Mouse > Switch primary and secondary buttons... Is there some sort of dll you can call to do this automatically?

Edited by Piano_Man
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

Registry would make sense:

HKCU\Control Panel\Mouse\SwapMouseButtons

0 for standard 1 for inverted as you want.

However i have just been toying with it, and if i change it in the registry, it does not take, it only applies if i change it via control panel and click apply.

Link to comment
Share on other sites

Registry would make sense:

HKCU\Control Panel\Mouse\SwapMouseButtons

0 for standard 1 for inverted as you want.

However i have just been toying with it, and if i change it in the registry, it does not take, it only applies if i change it via control panel and click apply.

That's like changing the desktop wallpaper, you can change the registry entry but nothing happens... I was hoping there was some sort of dll that would actually activate the inverted style.
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

You would do it with a simple api call Piano Man:

;Set SwapMouseButton to true.  Now the left button will be the right button and vise versa.
DllCall("user32.dll","int","SwapMouseButton","int",1)
sleep(5000)
;Now that you see that it worked, it gets real annoying real fast.  So you have to switch it back:
DllCall("user32.dll","int","SwapMouseButton","int",0)

That should do it.

@DllCallBeginners: If you plan to call user32.dll frequently, use DllOpen() and then DllCall() the open dll handle. Don't forget to close it when you are done with DllClose().

-The Kandie Man ;-)

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Link to comment
Share on other sites

You would do it with a simple api call Piano Man:

;Set SwapMouseButton to true.  Now the left button will be the right button and vise versa.
DllCall("user32.dll","int","SwapMouseButton","int",1)
sleep(5000)
;Now that you see that it worked, it gets real annoying real fast.  So you have to switch it back:
DllCall("user32.dll","int","SwapMouseButton","int",0)

That should do it.

@DllCallBeginners: If you plan to call user32.dll frequently, use DllOpen() and then DllCall() the open dll handle. Don't forget to close it when you are done with DllClose().

-The Kandie Man ;-)

Thanks, that works great!
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...