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#
Developer technologies | C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
0 comments No comments
{count} votes

Answer accepted by question author
  1. RLWA32 51,366 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' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.