Find the answer to your Linux question:
Results 1 to 6 of 6
Hi everyone , I've recently installed ubuntu. I'm working on a project for which I have to capture the mouse events. Also besides capturing the events i have to display ...
  1. #1
    Just Joined!
    Join Date
    Sep 2008
    Posts
    9

    Question Mouse event handling in Ubuntu

    Hi everyone ,

    I've recently installed ubuntu. I'm working on a project for which I have to capture the mouse events.

    Also besides capturing the events i have to display a secondary cursor on the screen.

    Please i need help as this project holds grave importance in our college curriculum.

    I've been researching on this but my efforts have been in vain.
    I'm aware that the driver writes to the /dev/input file but i need write a program to do all this.

    Any kind of help would be appreciated.

  2. #2
    Just Joined!
    Join Date
    Sep 2008
    Posts
    4
    To capture the mouse event you could use the XGrabPointer() function from Xlib, but then the mouse events aren't send on to the windows, so then won't react on a mouseclick
    more info here:
    http://www.tronche.com/gui/x/xlib
    Xlib Programming Manual: Pointer Grabbing

  3. #3
    Linux Enthusiast gerard4143's Avatar
    Join Date
    Dec 2007
    Location
    Canada, Prince Edward Island
    Posts
    714
    This project....what will it be written in...GTK+, qt...etc

  4. #4
    Just Joined!
    Join Date
    Sep 2008
    Posts
    9

    Smile Mouse event

    Thanls for the reply,

    It has been told to my project group that a separate cursor is to be created using GTK+2.

    After we have displayed the mouse on the screen we are suppose to simply move the cusor or show some events such as a right click.

    It would be really helpful of you if you could direct me on how a C code can be written for this.

    Any documents or examples would be really helpful

    Thank you

  5. #5
    Linux Enthusiast gerard4143's Avatar
    Join Date
    Dec 2007
    Location
    Canada, Prince Edward Island
    Posts
    714
    Here's a good starting point

    GNOME Library

    Plus look at the the posting "XLib question", it has some code for dealing with the mouse in GTK+

  6. #6
    Just Joined!
    Join Date
    Sep 2008
    Posts
    9

    Question Uinput driver

    Hi,

    I went through Xlib manual it was quite helpful.

    But the project guide has asked us to do it using Uinput driver.

    I've gone through Uinput driver but have understood very little of it since i am new to linux.

    Can u direct me as to how i've to go about the similar problem using UINPUT driver?

    If you could suggest any material or exammples it would really helpful.

    Thank you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...