Results 1 to 13 of 13

Thread: How can I use QT to make an application that simulates a mouse Bluetooh (HID)?

  1. #1
    Join Date
    May 2010
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question How can I use QT to make an application that simulates a mouse Bluetooh (HID)?

    Hello, How can I use QT to make an application in C + + that simulates mouse Bluetooh (HID)? I know I can use "QMouseEvent: globalPos () const" to the mouse coordinates, but still have not found how to send that information as a mouse bluethooth.

    Thanks ..

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How can I use QT to make an application that simulates a mouse Bluetooh (HID)?

    If you wish to emulate a bluetooth mouse then you will need to write a driver which pretends to be a bluetooth mouse driver. You can't do it in Qt.

    You can simulate mouse buttons and mouse position movement, but it will not simulate mouse bluetooth and it will be OS specific.

  3. #3
    Join Date
    May 2010
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How can I use QT to make an application that simulates a mouse Bluetooh (HID)?

    Then QT has no resources to develop applications using the client bluetooth HID (Human Interface Devices Bluetooth) to communicate with existing services hid in most OS's ?

  4. #4
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How can I use QT to make an application that simulates a mouse Bluetooh (HID)?

    Qt is much generic than that - it doesn't care if your mouse is bluetooth, built in, or whatever. For example, on Windows, the OS will simply send a message to Qt saying "Mouse position changed", "Mouse buttons changed state", etc.

  5. #5
    Join Date
    May 2010
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How can I use QT to make an application that simulates a mouse Bluetooh (HID)?

    sorry if im being repetitive, I just want to use QT to make a simple remote control of PC, the idea is to control my pc from my n800, is possible? exist examples? How i can start?

    ps: thanks for your patience, I'm from Brazil and my english sucks and

  6. #6
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How can I use QT to make an application that simulates a mouse Bluetooh (HID)?

    You can use OS specific API function to do that (such as SetCursorPos), or you could just use VNC which already allows you to control your PC from an N800.

  7. #7
    Join Date
    May 2010
    Posts
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: How can I use QT to make an application that simulates a mouse Bluetooh (HID)?

    The bluemaemo application does that already on maemo platforms.

  8. #8
    Join Date
    May 2010
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How can I use QT to make an application that simulates a mouse Bluetooh (HID)?

    yes I want to implement an aplication similar to bluemaemo, but more simple (just with mouse) to education propose! But I still do not know how to do using the resources of the QT.

  9. #9
    Join Date
    May 2010
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How can I use QT to make an application that simulates a mouse Bluetooh (HID)?

    Hi fatjuicymole.
    Thanks, but my intention is to make my own application, learning the QT and the handle Bluetooth devices. Can you indicate an example?.

  10. #10
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How can I use QT to make an application that simulates a mouse Bluetooh (HID)?

    Example:

    Qt Code:
    1. INPUT Mouse;
    2. // left down
    3. Mouse.type = INPUT_MOUSE;
    4. Mouse.mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
    5. ::SendInput(1,&Mouse,sizeof(INPUT));
    6. Mouse.mi.dwFlags = MOUSEEVENTF_LEFTUP;
    7. ::SendInput(1,&Mouse,sizeof(INPUT));
    To copy to clipboard, switch view to plain text mode 

    More docs: http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx

  11. #11
    Join Date
    May 2010
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default

    Hello friends, I would like thanks the help, please forgive my little exeperiencia, it would be possible to post a complete example so I can view the operation?
    But I still do not know how the application will communicate with the system, and how will the passage of events like a bluetooth mouse.
    Last edited by wysota; 4th May 2010 at 22:34.

  12. #12
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How can I use QT to make an application that simulates a mouse Bluetooh (HID)?

    Just create a QTimer, and connect it's signal to the above code. Move your mouse and you'll notice that the left button is clicked for you when the timer expires. If you look at the docs, you can also change the mouse position and emulate a keyboard.

  13. #13
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How can I use QT to make an application that simulates a mouse Bluetooh (HID)?

    Quote Originally Posted by andreGama View Post
    sorry if im being repetitive, I just want to use QT to make a simple remote control of PC, the idea is to control my pc from my n800, is possible? exist examples? How i can start?
    The way this is usually done is through a dedicated bluetooth service that has to be running on the device to be controlled as part of the bluetooth stack.

    http://en.wikipedia.org/wiki/Bluetooth_profile

    I'm not sure if this is actually done by HID profile but regardless of that you need a low-level access to the bluetooth channel to be able to send appropriate commands through the profile. Qt doesn't provide wrappers over things like that. And remember this is done on the sender side, the receiving side needs the service I mentioned earlier. A much simpler thing to do would be to provide your own communication and your own protocol. Then (I guess) you can use the code fatjuicymole presented.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. How to make an xpm or QIcon have the application colors?
    By lalesculiviu in forum Qt Programming
    Replies: 0
    Last Post: 21st October 2009, 11:11
  2. Need advice for a best way to make this application
    By frenk_castle in forum Newbie
    Replies: 3
    Last Post: 25th September 2009, 18:55
  3. Mouse tracking outside the application interface
    By sophister in forum Qt Programming
    Replies: 7
    Last Post: 2nd May 2009, 06:44
  4. Replies: 11
    Last Post: 15th July 2008, 13:11
  5. which class i should used to make chat application ??
    By kunalnandi in forum Qt Programming
    Replies: 3
    Last Post: 3rd May 2008, 09:33

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.