Hello,
im having some trouble with the setting of the joystick.
My main purpose is to be able to control with the joystick on specific form (something like cursor moving)
BUT to be able to move the focus to other windows/forms. what happens now, looking on the sdk example, is that the event is been checked in the "WndProc(Message)" func of the specific form, but if im not focused on that form... the joystick doesnt do anything (on the wanted form).
Do you have any idea what can i do to make the event of the joystick work non stop when the joystick is connected and how can i track the messeges that it send to the computer without "WndProc(Message)"?
Thank you very much,
Eyal Maoz
c# programing with the Space Navigator
Moderator: Moderators
Re: c# programing with the Space Navigator
If you just want to move the cursor, the driver can do that for you.
If you need to get the data in your application regardless of the position of the cursor, use the SiGrabDevice API call. The driver will only send data to your application while the hard grab is in effect. No other application will get data while you have it grabbed.
There are other options if this doesn't work for you.
If you need to get the data in your application regardless of the position of the cursor, use the SiGrabDevice API call. The driver will only send data to your application while the hard grab is in effect. No other application will get data while you have it grabbed.
There are other options if this doesn't work for you.
Re: c# programing with the Space Navigator
Hey! Thank you for the reply!jwick wrote: ↑Thu Jul 05, 2018 9:10 am If you just want to move the cursor, the driver can do that for you.
If you need to get the data in your application regardless of the position of the cursor, use the SiGrabDevice API call. The driver will only send data to your application while the hard grab is in effect. No other application will get data while you have it grabbed.
There are other options if this doesn't work for you.
Where is the SiGrabDevice? How do i call it from the progrem?
Couldnt find a function with this name...
Re: c# programing with the Space Navigator
Why cant i see this function? Where is it suppose to be?
The SiGrabDevice
The SiGrabDevice
Re: c# programing with the Space Navigator
I see. We didn't get import it in the Siapp.cs sample file.
You have two options, depending on the distribution of the app. That is, if it should cooperate with other apps that want to use the 3D mouse.
1) Create a cfg file for your app that specifies <Grab>Hard</Grab>. This isn't recommended for production use.
2) Import the function from the C DLL (see C API doc). This is probably what the Import looks like:
In both cases, an exclusive/hard Grab means only your app gets data while it is running. This isn't nice to other apps that may be running, but sometimes it is necessary. Using the function allows you to turn on/off the Grab as needed. E.g., when your app loses focus, you should release the Grab.
You have two options, depending on the distribution of the app. That is, if it should cooperate with other apps that want to use the 3D mouse.
1) Create a cfg file for your app that specifies <Grab>Hard</Grab>. This isn't recommended for production use.
Code: Select all
<AppCfg ThisFileVersion="1.4" CfgFormatVersion="1.2" xmlns="" Default="true">
<AppInfo>
...
</AppInfo>
<CfgProperties>
<Grab>Hard</Grab>
</CfgProperties>
...
Code: Select all
[DllImport(SI_DLL)]
public static extern SpwRetVal SiGrabDevice([In] IntPtr hdl, [In] long exclusive);
Re: c# programing with the Space Navigator
Perfect! Thank you so much.