BOOL SwapMouseButton(fSwap) | |||||
BOOL fSwap; | /* reverse or restore buttons | */ |
The SwapMouseButton function reverses the meaning of left and right mouse buttons.
fSwap
Specifies whether the button meanings are reversed or restored. If this parameter is TRUE, the left button generates right-button mouse messages and the right button generates left-button messages. If this parameter is FALSE, the buttons are restored to their original meanings.
The return value specifies the meaning of the mouse buttons immediately before the function is called. It is nonzero if the meaning was reversed. Otherwise, it is zero.
Button swapping is provided as a convenience to people who use the mouse with their left hands. The SwapMouseButton function is usually called by Control Panel only. Although an application is free to call the function, the mouse is a shared resource and reversing the meaning of the mouse button affects all applications.
The following example swaps the mouse buttons, depending on the check state of a check box:
BOOL fSwap;
fSwap = (BOOL) SendDlgItemMessage(hdlg, IDD_SWAP,
BM_GETCHECK, 0, 0L);
SwapMouseButton(fSwap);