How to GET current primary mouse button settings using Win32 c#

Jone Selas 81 Reputation points
2021-12-22T09:11:29.237+00:00

For setting the primary button I am using the SystemParametersInfoA method.

const int SPI_SETMOUSEBUTTONSWAP = 33;
SystemParametersInfo(SPI_SETMOUSEBUTTONSWAP, button, String.Empty, SPIF_UPDATEINIFILE | SPIF_SENDCHANGE);

But for getting the current mouse button I am not able to find any functions in SystemParametersInfoA.
Is there any function to get the mouse button using Win32 or any other?
159638-image.png

Windows development | Windows API - Win32
Developer technologies | C#
0 comments No comments
{count} votes

Accepted answer
  1. RLWA32 49,536 Reputation points
    2021-12-22T09:22:42.477+00:00

    According to the documentation for SystemParametersInfo - "To retrieve the current setting, call GetSystemMetrics with the SM_SWAPBUTTON flag". GetSystemMetrics function

    SM_SWAPBUTTON
    23 Nonzero if the meanings of the left and right mouse buttons are swapped; otherwise, 0.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.