AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DLLCall: Support for Human Interface devices
Goto page 1, 2, 3, 4, 5, 6, 7  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Micha



Joined: 15 Nov 2005
Posts: 433
Location: Germany

PostPosted: Tue Nov 15, 2005 11:26 am    Post subject: DLLCall: Support for Human Interface devices Reply with quote

Hi,
my remote control has a USB-Receiver. This gadget is recognized by Windows as a HID-device. In your own application you are not able to receive any input without registering the correct device.

I wanted to use ALL keys on my remote control to remote control my computer and my software-DVD-player.
As written above, without registering the device Autohotkey wasn't informed by the OS if a key was pressed on the remote control.

I've tried to make a DLL which can be used by the Autohotkey-DLLCALL-feature to support such devices.

At http://autohotkey.net/~Micha/HIDsupport/Autohotkey.html
you can download an archive with the needed files.

I've tried to write a little more information on that webspace (in very bad english, sorry Wink )

If you have any questions or problems, you can send me a message or post to this forum

Ciao
Micha


Last edited by Micha on Mon Aug 27, 2007 9:33 pm; edited 4 times in total
Back to top
View user's profile Send private message
not-logged-in-daonlyfreez
Guest





PostPosted: Tue Nov 15, 2005 12:05 pm    Post subject: Reply with quote

Looks very good! Smile

I tried the script, but it errors out on me:

Quote:
GetDeviceCount fehlgeschlagen. Errorcode: -3


I'm on Win2k/SP4, all updates...

But very cool Cool ...

I trust you found the WinLIRC script by Chris? Could your DLL be used to capture input from 'all' remotes (i.e.: make WinLIRC unneeded for it)?
Back to top
Micha



Joined: 15 Nov 2005
Posts: 433
Location: Germany

PostPosted: Tue Nov 15, 2005 12:29 pm    Post subject: < Windows XP Reply with quote

Hi not-logged-in-daonlyfreez,

sorry, I forgot to mention that the Windows API only supports Windows XP Sad. I've updated my webpage with this clue.
The errorcode -3 says:
ERROR_PATH_NOT_FOUND: The system cannot find the path specified.
It seems that the script was not able to find the DLL.

Quote:
I trust you found the WinLIRC script by Chris? Could your DLL be used to capture input from 'all' remotes (i.e.: make WinLIRC unneeded for it)?


As far as i know, winlirc supports (almost any) serial attached IR-devices. It interprets the signals from any remote control.

My code only works for devices windows is able to recognize.
That is winlirc is doing a great job to use almost any remote control, my dll only calls Windows-APIs to support HID-devices.

Ciao
Micha
Back to top
View user's profile Send private message
not-logged-in-daonlyfreez
Guest





PostPosted: Tue Nov 15, 2005 2:13 pm    Post subject: Reply with quote

Your script and dll were in the same folder.

Got this (more clarifying) errormessage now too:

Quote:
The procedure entry point GetRawInputData could not be located in the dynamic link library USER32.dll.


Any chance of making this work on other Windows OSs too?
Back to top
Micha



Joined: 15 Nov 2005
Posts: 433
Location: Germany

PostPosted: Tue Nov 15, 2005 2:28 pm    Post subject: Reply with quote

Quote:
The procedure entry point GetRawInputData could not be located in the dynamic link library USER32.dll.
Any chance of making this work on other Windows OSs too?


This means, I've used a function that your OS is unable to find in its system-dlls, because they doesn't exists before Windows XP.

I'm sorry, but I think it's not possible to make this work on earlier OS's without enourmous work.

Ciao
micha
Back to top
View user's profile Send private message
evl



Joined: 24 Aug 2005
Posts: 1238

PostPosted: Tue Dec 27, 2005 12:44 am    Post subject: Reply with quote

@Micha:
Interesting stuff! Wish I'd realised your dll could handle USB keyboards earlier as it seems to detect all the media buttons when I press them!

I've not had a chance to examine the code yet, but playing with your AutoHotkeyRemoteControlDLL script, I've found that the media keys are detected as an HID device, while the scroll wheel on the keyboard is detected by a mouse device (looks like its values should be distinguishable from the actual mouse) and 2 other extra buttons are similarly detected by the main keyboard device, but again should be distinguisable from the normal keys they sort of duplicate.

I've disabled the keyboard's own program from starting (that managed the key presses and ran programs, etc) and I'm hoping to customise their actions now, which wasn't really possible before Very Happy
Back to top
View user's profile Send private message
Micha



Joined: 15 Nov 2005
Posts: 433
Location: Germany

PostPosted: Tue Dec 27, 2005 9:31 pm    Post subject: Reply with quote

@evl: I'm glad that my little work can help you !
Back to top
View user's profile Send private message
Psi-Jack



Joined: 24 Dec 2005
Posts: 7
Location: Austin, TX

PostPosted: Wed Dec 28, 2005 4:21 pm    Post subject: Very nice stuff.. Reply with quote

Hello Micha. First of all, I wanted to say:

EXCLENT WORK

This is absolutely wonderful work. I could finally re-hook my keyboard back up normally through USB, instead of that god-awful PS/2 hack.
Among that, of course, using other USB-based deviced for ahk as well, which could be useful. Twisted Evil

I noticed, in your samples, though, a bit of a flaw.
In your InputMsg, you should localize the Vals variable, so that each time the function is used, it's a fresh new Vals v ariable. I noticed that very quickly when I kept getting a big HUGE page of Vals in a MsgBox, when I had that on for finding keys. It still happends, occasionally even with it, but it certainly cleared it up a bit.

Anyone for ideas?

I'm trying to take HID-keys that give no scancode, and essentially re-send them back through as custom vk+sc key sequences. But I tried doing that with my script as-is, but, ahk keeps flagging them for ignored, and won't actually proccess the keystrokes. :/

And, also, anyone know of a VK and SC table of keys? With me re-mapping (or trying to), these buttons to scancodes, I want to help make sure I'm not using existing ones elsewhere, or.. I guess I could just plug it up to PS/2, and re-map them to what it would report. Didn't think of that till now. Oh well. Smile

I do need help, though, as to why virtually-made scancodes aren't working. :/

-- Psi-Jack
Back to top
View user's profile Send private message Yahoo Messenger
evl



Joined: 24 Aug 2005
Posts: 1238

PostPosted: Wed Mar 29, 2006 12:47 am    Post subject: Reply with quote

Time to say thanks for this excellent dll file again Laughing I just got a Logitech USB Headset 350 with an in-line remote and your dll allows me to display the volume when I press the up and down buttons (pity the Mic mute button doesn't send a message too). Thanks again Exclamation

(I'll post a script for the headset soon)
Back to top
View user's profile Send private message
Rajat



Joined: 28 Mar 2004
Posts: 1717

PostPosted: Tue May 30, 2006 7:56 pm    Post subject: Reply with quote

Hi Micha

this looks great!
I've a Tv tuner card with remote... got anything for that? Smile
a recent similar post brought me here.
_________________
Back to top
View user's profile Send private message
Micha



Joined: 15 Nov 2005
Posts: 433
Location: Germany

PostPosted: Tue May 30, 2006 9:02 pm    Post subject: Reply with quote

Hi Rajat,
welcome back!

Well, you can try, if your remote control is recognized as HID-Device.
If the functionality is on the board, the possibility is high that you need special drivers to communicate with the remote control and my dll is useless for you.

If it doesn't work, you could post the exact name and revision of your card and I can google if there's a SDK or something out there.
Ciao
Micha
Back to top
View user's profile Send private message
Rajat



Joined: 28 Mar 2004
Posts: 1717

PostPosted: Tue May 30, 2006 10:15 pm    Post subject: Reply with quote

thanks!

no the remote doesn't show in HID... checked that before my last post.
it plugs into the tuner card. the model is generally knows as a Philips SAA713x model (mine's 7130).

don't bother going out of the way on this... i just meant to ask if there's a way i could use the .dll u've already worked on, with my IR receiver.
_________________
Back to top
View user's profile Send private message
XavierGr



Joined: 15 Jul 2006
Posts: 42

PostPosted: Sat Jul 15, 2006 1:36 am    Post subject: Reply with quote

Hello Micha!

Seems to be extraordinary work!
Do you think that it can work with logitech mice that are recognized as HID devices?

I am trying to find a way to utilize all my special mouse buttons without the need of Logitech's Setpoint program (which is crap by the way).
Main problem is that vk sc codes can't be sniffed by #InstallMouseHook.
I thought of other ways such as "GetMessage" but that didn't worked either.

I played with DllCall too, but I was quickly lost.
I will give a try to your way and if this works I will be greatfull to you.
_________________
One hotkey to rule them all!
Back to top
View user's profile Send private message
Micha



Joined: 15 Nov 2005
Posts: 433
Location: Germany

PostPosted: Tue Jul 18, 2006 11:51 am    Post subject: Reply with quote

Hi XavierGr,
sorry for answering so late, but my main job at home is cutting my 4.5 h marriage video Smile

I have a 5 button M$ mouse. I'll try to get it work with the dll.
If it works there's a change that Logitec mice are working too.
I'll post if I have news

Ciao
Micha
Back to top
View user's profile Send private message
Micha



Joined: 15 Nov 2005
Posts: 433
Location: Germany

PostPosted: Tue Jul 25, 2006 11:33 am    Post subject: Reply with quote

Hi,
yes it should work. I've tested it with a M$ and a Logitech USB-Mouse

The demoscript states
Leftclick: 1
RightClick: 2
Middle: 4
4th Button: 8
5th Button 16

Ciao
Micha
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page 1, 2, 3, 4, 5, 6, 7  Next
Page 1 of 7

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group