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 API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,426 questions
C#
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.
10,277 questions
0 comments No comments
{count} votes

Accepted answer
  1. RLWA32 40,571 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