Esempio n. 1
0
        /// <summary>	
        /// Sets the data format for a device and maps application-defined actions to device objects. It also sets the buffer size for buffered data.	
        /// </summary>	
        /// <param name="arg0"><dd> Address of a <see cref="SharpDX.DirectInput.ActionFormat"/> structure containing information about the action map to be applied.  </dd></param>	
        /// <param name="arg1"><dd> Unicode string that specifies the name of the user for which the action map is being set. A value of <c>null</c> specifies the user currently logged into the system.  </dd></param>	
        /// <param name="arg2"><dd> DWORD value that specifies how the action map is applied. This can be one of the following values.  <dl> <dt>DIDSAM_DEFAULT</dt> <dd> Set the action map for this user. If the map differs from the current map, the new settings are saved to disk. </dd> <dt>DIDSAM_FORCESAVE</dt> <dd> Always save the configuration to disk. </dd> <dt>DIDSAM_NOUSER</dt> <dd> Reset user ownership for this device in the default configuration property sheet. Resetting user ownership does not remove the current action map. </dd> </dl> </dd></param>	
        /// <returns><p>If the method succeeds, the return value can be one of the following error values: <see cref="SharpDX.DirectInput.ResultCode.Ok"/>, <see cref="SharpDX.DirectInput.ResultCode.SettingsNotSaved"/>, or <see cref="SharpDX.DirectInput.ResultCode.WriteProtect"/>. If the method fails, the return value can be one of the following error values: <see cref="SharpDX.DirectInput.ResultCode.Acquired"/> or <see cref="SharpDX.DirectInput.ResultCode.InvalidParam"/>, <see cref="SharpDX.DirectInput.ResultCode.SettingsNotSaved"/>, <see cref="SharpDX.DirectInput.ResultCode.WriteProtect"/>, <see cref="SharpDX.DirectInput.ResultCode.Acquired"/>, <see cref="SharpDX.DirectInput.ResultCode.InvalidParam"/>.</p></returns>	
        /// <remarks>	
        /// <p>This method provides the mechanism to change action-to-control mapping from the device defaults. An application must use this method to map its in-game actions to virtual controls.</p> <p>The user name passed to this method binds a set of action mappings for a device to a specific user. Settings are automatically saved to disk when they differ from the currently applied map. Applications that accept input from multiple users should be very careful when applying action maps to the system mouse or keyboard, as the action maps for each user may conflict.</p> <p>The method can be called only when the device is not acquired.</p> <p>If <see cref="SharpDX.DirectInput.Device.BuildActionMap"/> succeeds but no actions have been mapped, a subsequent call to <see cref="SharpDX.DirectInput.Device.SetActionMap"/> will return <see cref="SharpDX.DirectInput.ResultCode.Ok"/> but a call to <see cref="SharpDX.DirectInput.Device"/> Interface will fail with <see cref="SharpDX.DirectInput.ResultCode.InvalidParam"/>.</p>	
        /// </remarks>	
        /// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='IDirectInputDevice8W::SetActionMap']/*"/>	
        /// <msdn-id>microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.setactionmap</msdn-id>	
        /// <unmanaged>HRESULT IDirectInputDevice8W::SetActionMap([In] DIACTIONFORMATW* arg0,[In] const wchar_t* arg1,[In] unsigned int arg2)</unmanaged>	
        /// <unmanaged-short>IDirectInputDevice8W::SetActionMap</unmanaged-short>	
        internal void SetActionMap(ref SharpDX.DirectInput.ActionFormat arg0, string arg1, int arg2) {
            unsafe {
                var arg0_ = new SharpDX.DirectInput.ActionFormat.__Native();
                arg0.__MarshalTo(ref arg0_);
                IntPtr arg1_ = Utilities.StringToHGlobalUni(arg1);
                SharpDX.Result __result__;
                __result__= 
				SharpDX.DirectInput.LocalInterop.Calliint(_nativePointer, &arg0_, (void*)arg1_, arg2,((void**)(*(void**)_nativePointer))[30]);		
                arg0.__MarshalFree(ref arg0_);
                Marshal.FreeHGlobal(arg1_ );
                __result__.CheckError();
            }
        }
Esempio n. 2
0
        /// <summary>	
        /// Enumerates devices that most closely match the application-specified action map.	
        /// </summary>	
        /// <param name="arg0"><dd> String identifying the current user, or <c>null</c> to specify the user logged onto the system. The user name is taken into account when enumerating devices. A device with user mappings is preferred to a device without any user mappings. By default, devices in use by other users are not enumerated for this user. </dd></param>	
        /// <param name="arg1"><dd> Address of a <see cref="SharpDX.DirectInput.ActionFormat"/> structure that specifies the action map for which suitable devices are enumerated.  </dd></param>	
        /// <param name="arg2"><dd> Address of a callback function to be called once for each device enumerated. See DIEnumDevicesBySemanticsCallback.  </dd></param>	
        /// <param name="arg3"><dd> Application-defined 32-bit value to pass to the enumeration callback each time it is called.  </dd></param>	
        /// <param name="arg4"><dd> Flag value that specifies the scope of the enumeration. This parameter can be one or more of the following values.  <dl> <dt>DIEDBSFL_ATTACHEDONLY</dt> <dd>Only attached and installed devices are enumerated. </dd> <dt>DIEDBSFL_AVAILABLEDEVICES</dt> <dd>Only unowned, installed devices are enumerated. </dd> <dt>DIEDBSFL_FORCEFEEDBACK</dt> <dd>Only devices that support force feedback are enumerated. </dd> <dt>DIEDBSFL_MULTIMICEKEYBOARDS</dt> <dd>Only secondary (non-system) keyboard and mouse devices. </dd> <dt>DIEDBSFL_NONGAMINGDEVICES</dt> <dd>Only HID-compliant devices whose primary purpose is not as a gaming device. Devices such as USB speakers and multimedia buttons on some keyboards would fall within this value. </dd> <dt>DIEDBSFL_THISUSER</dt> <dd>All installed devices for the user identified by  ptszUserName, and all unowned devices, are enumerated. </dd> <dt>DIEDBSFL_VALID</dt> <dd>DIEDBSFL_VALID is also defined in Dinput.h, but is not used by applications. </dd> </dl> </dd></param>	
        /// <returns><p>If the method succeeds, the return value is <see cref="SharpDX.DirectInput.ResultCode.Ok"/>. If the method fails, the return value can be one of the following error values: <see cref="SharpDX.DirectInput.ResultCode.InvalidParam"/>, <see cref="SharpDX.DirectInput.ResultCode.NotInitialized"/>.</p></returns>	
        /// <remarks>	
        /// <p>The keyboard and mouse are enumerated last.</p> <table><tr><th>Note </th></tr><tr><td>The order in which devices are enumerated by DirectInput is not guaranteed.</td></tr></table>	
        /// </remarks>	
        /// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='IDirectInput8W::EnumDevicesBySemantics']/*"/>	
        /// <msdn-id>microsoft.directx_sdk.idirectinput8.idirectinput8.enumdevicesbysemantics</msdn-id>	
        /// <unmanaged>HRESULT IDirectInput8W::EnumDevicesBySemantics([In] const wchar_t* arg0,[In] DIACTIONFORMATW* arg1,[In] __function__stdcall* arg2,[In] void* arg3,[In] unsigned int arg4)</unmanaged>	
        /// <unmanaged-short>IDirectInput8W::EnumDevicesBySemantics</unmanaged-short>	
        internal void EnumDevicesBySemantics(string arg0, ref SharpDX.DirectInput.ActionFormat arg1, SharpDX.FunctionCallback arg2, System.IntPtr arg3, int arg4) {
            unsafe {
                IntPtr arg0_ = Utilities.StringToHGlobalUni(arg0);
                var arg1_ = new SharpDX.DirectInput.ActionFormat.__Native();
                arg1.__MarshalTo(ref arg1_);
                SharpDX.Result __result__;
                __result__= 
				SharpDX.DirectInput.LocalInterop.Calliint(_nativePointer, (void*)arg0_, &arg1_, arg2, (void*)arg3, arg4,((void**)(*(void**)_nativePointer))[9]);		
                Marshal.FreeHGlobal(arg0_ );
                arg1.__MarshalFree(ref arg1_);
                __result__.CheckError();
            }
        }