Hello,
I would like to use my spaceMouse plus with Qt but I have problem with the "SiOpen" function. In fact, this function asks the "Application name" but with Qt there isn't an AppName. Is there anybody who could help me?
Thanks
spaceMouse Plus and QT on Windows
Moderator: Moderators
The application name argument is rather arbitrary. It should match what you include in your config file, but it isn't necessary. Your problem with Qt is probably going to be to provide a valid hwnd, and to break into the event loop to find out when you have received an event. There have been others that have made this work. Please post the essentials of your solution here if you get it to work.
-
- Posts: 4
- Joined: Fri Mar 07, 2008 1:53 am
-
- Posts: 4
- Joined: Fri Mar 07, 2008 1:53 am
Hello,
I have used the "winEventFilter(MSG *, long *)' function because i couldn't use the "SiGetEvent (SiHdl hdl, int flags, SiGetEventData *pData, SiSpwEvent *pEvent)" function.
The problem comes from the "hdl" parameter because this the "ApplicationName". This is easy if you use the MFC because you define the "ApplicationName" but with Qt it looks impossible to get this "ApplicationName" (Window handle) because you don't define it.
Thanks
I have used the "winEventFilter(MSG *, long *)' function because i couldn't use the "SiGetEvent (SiHdl hdl, int flags, SiGetEventData *pData, SiSpwEvent *pEvent)" function.
The problem comes from the "hdl" parameter because this the "ApplicationName". This is easy if you use the MFC because you define the "ApplicationName" but with Qt it looks impossible to get this "ApplicationName" (Window handle) because you don't define it.
Thanks
I don't know if we are talking about the same things here.
The ApplicationName (pAppName) that is passed into the SiOpen function is a completely arbitrary string. You can make it anything you want.
The hWnd that is passed in to SiOpenWinInit has to be a hdl to a window somewhere in your process. This is the window where the 3Dx events are sent. You have to be able to get notified of events that appear on that hdl (or are propogated around from that hwnd). This would normally be the main window of the app.
Normally these frameworks have a way to get the hwnd of the main window. Something like QtMainWindow.
You can make your own window with Win32 functions and assign your own WndProc to it to get events. The window doesn't necessarily have to be displayed or get focus. It just has to be owned by your process.
Jim
3Dx Software Development
The ApplicationName (pAppName) that is passed into the SiOpen function is a completely arbitrary string. You can make it anything you want.
The hWnd that is passed in to SiOpenWinInit has to be a hdl to a window somewhere in your process. This is the window where the 3Dx events are sent. You have to be able to get notified of events that appear on that hdl (or are propogated around from that hwnd). This would normally be the main window of the app.
Normally these frameworks have a way to get the hwnd of the main window. Something like QtMainWindow.
You can make your own window with Win32 functions and assign your own WndProc to it to get events. The window doesn't necessarily have to be displayed or get focus. It just has to be owned by your process.
Jim
3Dx Software Development