Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

DLLCall: Support for Human Interface devices


  • Please log in to reply
43 replies to this topic
Micha
  • Members
  • 539 posts
  • Last active: Dec 31 2011 01:43 PM
  • Joined: 15 Nov 2005
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 https://ahknet.autoh...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

Edit 04/2009 : Good things needs a while:-) TheGood created a script which does not need an extra dll. Please have a look at his post at
http://www.autohotke...topic41397.html

not-logged-in-daonlyfreez
  • Guests
  • Last active:
  • Joined: --
Looks very good! :)

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

GetDeviceCount fehlgeschlagen. Errorcode: -3


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

But very cool 8) ...

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)?

Micha
  • Members
  • 539 posts
  • Last active: Dec 31 2011 01:43 PM
  • Joined: 15 Nov 2005
Hi not-logged-in-daonlyfreez,

sorry, I forgot to mention that the Windows API only supports Windows XP :-(. 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.

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

not-logged-in-daonlyfreez
  • Guests
  • Last active:
  • Joined: --
Your script and dll were in the same folder.

Got this (more clarifying) errormessage now too:

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?

Micha
  • Members
  • 539 posts
  • Last active: Dec 31 2011 01:43 PM
  • Joined: 15 Nov 2005

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

evl
  • Members
  • 1237 posts
  • Last active: Oct 20 2010 11:41 AM
  • Joined: 24 Aug 2005
@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 :D

Micha
  • Members
  • 539 posts
  • Last active: Dec 31 2011 01:43 PM
  • Joined: 15 Nov 2005
@evl: I'm glad that my little work can help you !

Psi-Jack
  • Members
  • 7 posts
  • Last active: Dec 28 2005 11:50 PM
  • Joined: 24 Dec 2005
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:

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. :)

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

-- Psi-Jack

evl
  • Members
  • 1237 posts
  • Last active: Oct 20 2010 11:41 AM
  • Joined: 24 Aug 2005
Time to say thanks for this excellent dll file again :lol: 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 :!:

(I'll post a script for the headset soon)

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
Hi Micha

this looks great!
I've a Tv tuner card with remote... got anything for that? :)
a recent similar post brought me here.

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


Micha
  • Members
  • 539 posts
  • Last active: Dec 31 2011 01:43 PM
  • Joined: 15 Nov 2005
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

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
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.

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


XavierGr
  • Members
  • 48 posts
  • Last active: Feb 02 2012 04:59 PM
  • Joined: 15 Jul 2006
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!

Micha
  • Members
  • 539 posts
  • Last active: Dec 31 2011 01:43 PM
  • Joined: 15 Nov 2005
Hi XavierGr,
sorry for answering so late, but my main job at home is cutting my 4.5 h marriage video :-)

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

Micha
  • Members
  • 539 posts
  • Last active: Dec 31 2011 01:43 PM
  • Joined: 15 Nov 2005
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