Welcome to the forums.
Well, I don't know if I got your question right but I'll give it a shot anyway:
Basically, you can use any API function in PureBasic even if they are not defined,
ie API_Function_().
To do that, you could either access the appropriate DLL directly, like...
Code: Select all
OpenLibrary(0, "user32.dll")
*f = IsFunction(0, "GetRawInputData")
If *f
If CallFunctionFast(*f, hRawInput.RAWINPUT, #RID_INPUT, #NULL, @pcbSize.l, SizeOf(RAWINPUTHEADER)) <> -1
;
; yadayadayada
;
EndIf
EndIf
CloseLibrary(0)
...or alternatively use PB's DLL-Importer. That's a matter of taste and handling.
The next issue you'll encounter is that none of the structures or constants you need
are pre-defined in PureBasic but that shouldn't be much of a problem.
With a basic understanding of C (or good imagination

) you'll be able to convert
the required headers to PB in next to no time.
I had a quick peek at MSDN and found the following which may be useful to
give you an idea:
Code: Select all
; see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/userinput/rawinput.asp
#RID_INPUT = $10000003
Structure RAWINPUTHEADER
dwType.l
dwSize.l
hDevice.l
wParam.l
EndStructure
Structure usButtonHELP
usButtonFlags.w
usButtonData.w
EndStructure
Structure RAWMOUSE
usFlags.w
StructureUnion
ulButtons.l
usButton.usButtonHELP
EndStructureUnion
ulRawButtons.l
lLastX.l
lLastY.l
ulExtraInformation.l
EndStructure
Structure RAWKEYBOARD
MakeCod.w
Flags.w
Reserved.w
VKey.w
Message.l
ExtraInformation.l
EndStructure
Structure RAWHID
dwSizeHid.l
dwCount.l
bRawData.b
EndStructure
Structure RAWDATA
StructureUnion
mouse.RAWMOUSE
keyboard.RAWKEYBOARD
hid.RAWHID
EndStructureUnion
EndStructure
Structure RAWINPUT
header.RAWINPUTHEADER
Data.RAWDATA
EndStructure
I must admit, I never heard of these RawInput routines before and I should
already be sleeping for 2-3 hours now

- so please double-check the structures
as they may well contain errors!
BTW: As far as I could see you have to register the device beforehand but
you may already know that.
Hope that helps.