Program that simulates a button 4/5 button mouse

can be useful on G15 keyboards to name but 1 app

Code: c++
  1. //---------------------------------------------------------------------------
  2. #include
  3. #pragma hdrstop
  4. //---------------------------------------------------------------------------
  5. #pragma argsused
  6. WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
  7. {
  8. INPUT input[2];
  9. memset(input, 0, sizeof(input));
  10. input[0].type = INPUT_MOUSE;
  11. input[0].mi.dwFlags = MOUSEEVENTF_XDOWN; // no beneen
  12. input[0].mi.mouseData = XBUTTON1; // no beneen
  13. input[1].mi.dwFlags = MOUSEEVENTF_XUP; // no boven
  14. input[1].mi.mouseData = XBUTTON1; // no beneen
  15. SendInput(2,input,sizeof(INPUT));
  16. return 0;
  17. }
  18. //---------------------------------------------------------------------------
2,745 views 3 replies
Reply #1 Top
I compiled em for you ...
These work from XP up to vista 64 (tested)
(shame on me 123 kb a piece , LOL)

http://vasilkovsky.dommel.be/four_five.zip

------------------------------------------

Now for the discussion..

What i think about using button 4 and 5 ...

-In a lot of applications alt-Fx and ctrl-Fx keys are mapped to do something, especially in games .. that's why i think it's easier to disable button 4 and 5 usage on OS level and use those keys for multiplicity

- I think the code in multiplicity should be reviewed as to what button 4 and 5 actually do.. in my case i see the behavior of those buttons as erratic 4 sometimes brings me to screen 3 and skips screen 2 (i have 4 clients and 1 primary , the primary is located on the right edge)
Intuitively i think button 4 should switch screens to the left and button 5 to the right from the _Current_ screen , not from the primary.. as it is now it's not really working very well..(i'm hoping eventually it will)

-For people who use 3 button mice (like me) and have a keyboard with extra buttons , it would be good if the button 4 and 5 option were not greyed out , so those buttons can be mapped to the spare keys on the keyboard.. it would cause far less problems than mapping alt-Fx and ctrl-Fx keys to those keyboard buttons.(i have attached my horrible, useless sidewinder mouse on a spare usb so i can use my keyboard's mapped mouse 4 and 5 buttons (option is enabled in multiplicity)) and "wraped up the cord in a rubber band, and tucked it away in back." lol

I am interested in what my fellow multiplicity users think of this subject , so please guys reply and give comments , so we can positively feed them back at the dev team :)

Kind regards

D
Reply #2 Top
//Edited Longest. Topic. EVER. Please choose one that is smaller next time. 
Reply #3 Top
//Edited Longest. Topic. EVER. Please choose one that is smaller next time. 
End of quote


I'm sorry , i didn't notice .

Thank you for shortening it .

What do you think about the button 4 5 issue btw.. (i couldn't care less about IE forward and IE back), I 'm happy using them for multiplicity.