Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9268679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:55:09+00:00 2026-06-18T14:55:09+00:00

In Windows, there is a Win32 system call SwapMouseButton to swap the primary button

  • 0

In Windows, there is a Win32 system call SwapMouseButton to swap the primary button of the mouse. Now, I need such system call or way to swap mouse button on Linux and MacOS.
By this, I want to make one-click mouse button swapping application.

How would you do this in C?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T14:55:11+00:00Added an answer on June 18, 2026 at 2:55 pm

    I don’t think there is a system call to do this. The mouse is operated by the X system, not by the kernel.
    You can run this shell command xmodmap -e "pointer = 3 2 1" to swap the left and right buttons, and run xmodmap -e "pointer = 1 2 3" to restore the original settings..
    You can also use execve to execute the above command from C.

    EDIT

    The system function is actually more easy to use:

    system("xmodmap -e \"pointer = 3 2 1\""); // for swapping buttons
    system("xmodmap -e \"pointer = 1 2 3\""); // for restoring functionality
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

since Windows Vista there is an new Win32-API call CreateSymbolicLink to create a symbolic
There are now so many ways to write windows apps, win32, MFC, ATL, .NET,
Is there a Thread-Local Storage (TLS) equivalent for kernel-mode drivers in Windows (Win32 to
In C#/.NET (on Windows) is there a way to read a growing file using
Possible Duplicate: Objective C for Windows iPhone development on Windows Is there any way
A call to IRP_MJ_QUERY_INFORMATION is generated by functions such as Win32's GetFileInformationByHandle or the
I need to swap Alt keys functionality in Windows 7. A big company needs
I think there is no way to enumerate each network interface on my system
In the Java Control Panel on Windows there are settings for temporary internet files
When installing Windows services there are two options for automatically starting a Windows service

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.