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

  • SEARCH
  • Home
  • 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 7883291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:29:36+00:00 2026-06-03T04:29:36+00:00

currently am working on some sort of dynamic loading library plugins development. The plugin

  • 0

currently am working on some sort of dynamic loading library plugins development. The plugin will be loaded by other application. The programming language is C++.

I need to detect the mouse button condition on Unix such as MacOSX and Linux durning runtime. Say whether or not the left mouse button is currently holding or released at the application. The application itself doesn’t provide that feature to allow a library to do so.
In Windows I use mouse hook to capture that thing, but I couldn’t find an answer for Unix system.

  • 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-03T04:29:38+00:00Added an answer on June 3, 2026 at 4:29 am

    You haven’t said what method the host application is using to interact with the computer’s GUI. Raw X11? A toolkit like GTK+ (used by Gnome applications among others) or Qt (used by KDE applications among others)? In the MacOS case, is the host application using the native GUI or X11? Actually, it’s not even clear if you can assume that the host application has any GUI at all!

    If the host application is using a toolkit and you know which toolkit it is, then you should use whatever facility is provided by the toolkit to grab mouse events.

    If you cannot be sure what the host application is doing for its GUI or even if it has one, then you can always bypass X11 and access the mouse directly, but there is a large caveat with this: how will you know if you are accessing the correct mouse? Be aware that host host application might be running with a remote X11 display, or that it might be a non-GUI application running on some remote machine over an SSH connection. Is the mouse connected to the computer that is running the application (if there even is one!) really the mouse you want?

    If you still want to continue with this approach, under Linux you can open the virtual device /dev/input/mice… Or open a specific mouse using /dev/input/mouse0 or /dev/input/mouse1, etc… Reading from this device will give you data in the PS/2 format.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently working with some users that do not have the .NET Framework
I am currently working on some Ajax heavy code and I am wondering how
I'm currently working through some exercises in a c++ book, which uses text based
I am currently working on some simple custom allocators in c++ which generally works
I am currently working on some test cases for my website. I've managed to
I'm currently working on databinding some of my existing Windows Forms, and I've ran
Currently working on a VBScript to automate some of the dirty PST ingestion work
Some background I'm currently working on a mobile site so I keep switching user
I'm currently working on a project with some fancybox (inline content). I'd like to
I'm currently working on a Haskell project which automatically tests some functions based on

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.