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 ..;)
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.
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 ?
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.
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 :)
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.
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.
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.:(
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?.:cool:
Re: How can I use QT to make an application that simulates a mouse Bluetooh (HID)?
Example:
Code:
INPUT Mouse;
// left down
Mouse.type = INPUT_MOUSE;
Mouse.mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
::SendInput(1,&Mouse,sizeof(INPUT));
Mouse.mi.dwFlags = MOUSEEVENTF_LEFTUP;
::SendInput(1,&Mouse,sizeof(INPUT));
More docs: http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx
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.
Re: How can I use QT to make an application that simulates a mouse Bluetooh (HID)?
Quote:
Originally Posted by
andreGama
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.