AutoHotkey Community

It is currently May 27th, 2012, 5:19 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: December 25th, 2010, 2:45 am 
Offline

Joined: January 15th, 2007, 2:37 pm
Posts: 573
I know it's bad form to bump your own post but I'm hoping that some of you that were busy during the holidays may be able to help me with this now.

Merry Christmas Eve.

I know you're all spending time with your families but as usual I'm try to solve some of my problems.

I asked this awhile back but I'm still trying to figure it out. I have done a lot of studying and research and I have found a lot of new information. Hopefully someone can point me in the right direction.

To recap, I have a Gyration Media Center remote that all the buttons except the "Power" button are seen by AHKHID. It is only labeled "Power", it does not send any system commands. EventGhost does see the button and identifies it as Button-1. Button ID in EventGhost and AHKHID for all the buttons except the power button match. EventGhost sees four HID devices but doesn't list usage page info, AHKHID only sees three usage pages 12, 65280, 65486. I concluded the power button is on a usage page by itself.

Using the tool HidTest "http://www.lvr.com/hidpage.htm" I was able to determine that the usage page for the power button is 128 and the usage is 1. Looking at this chart I was able to find what all the usage pages are for. The chart is on page 15 of this document.
http://www.usb.org/developers/devclass_docs/Hut1_11.pdf

My first question is am I reading this chart correctly because if I am this just confuses me more. The usage pages are;
Code:
12 - consumer device
65280 - Vendor defined
65468 - Vendor defined
and
128 - Monitor
It seems very strange that the power button on a remote was assigned a monitor usage page.

I tried entering the usage page into AHKHID "Example 2" and into the example "Creating a script" but it still will not see the button.

So looking at AHKHID itself I followed the structure of "Creating a script" and tested the functions starting at the top testing "Get Device Count". I made this script to view the data.
Code:
;AHKHID_UseConstants()
Gui, Add, Edit, xm w50 vdevcount,
Gui, Add, Text, x+10, Device Count
Gui, Add, Edit, xm w50 velevel,
Gui, Add, Text, x+10, Error Level
Gui, Show,  y0
iCount := AHKHID_GetDevCount()
GuiControl, , devcount, %iCount%
GuiControl, , elevel, %ErrorLevel%
Return


It comes back with a device count of 10, which is what AHKHID "Example 1" sees, and an error level of 0 and has the same result if I include "Use Constants". Of course the tool HidTest sees a device count of 11. This makes me think that for some reason AHKHID is not reading all USB HID devices as it should. It seems to see usage pages lower and higher than this but doesn't see this one. Maybe it has an error or just needs to be tweeked but with my limited experience I can't tell what it may be so I'm stuck and don't know where else to look for more information.

Here is my... well you could call it deductive reasoning, as to why I believe there is a way to get AHKHID to recognize this button.

1. EventGhost sees it as a HID compliant device just like most of the rest of the buttons on the remote.

2. HidTest sees it as an HID device.

3. I've read in several places that there is no need to have special drivers for any USB device. The native windows drivers can handle any USB function.

If anyone can offer any advice at all I would greatly appreciate it. Getting this one little button working is something I want very badly, for more reasons than just having use of the button. I want to be able to expand this script I'm working on so more people can use their HID devices with AHK.
http://www.autohotkey.com/forum/viewtopic.php?t=41397&start=256

OH, I'm using Win XP SP3.
Thanks for any help you can give me.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 8th, 2011, 7:37 am 
Offline

Joined: January 15th, 2007, 2:37 pm
Posts: 573
Bump


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 8th, 2011, 7:25 pm 
Offline

Joined: January 15th, 2007, 2:37 pm
Posts: 573
One last bump in desperation for an answer.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 21st, 2011, 12:25 am 
Offline

Joined: July 30th, 2007, 11:32 pm
Posts: 581
Quote:
Looking at this chart I was able to find what all the usage pages are for.

Very interesting document. I'll add it to my collection. :)

From what you've said, I also believe AHKHID should be able to detect it.
This is rather hard to do without the ability to test it here, but I will look into it as much as I can.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 21st, 2011, 1:58 am 
Offline

Joined: July 30th, 2007, 11:32 pm
Posts: 581
After going through the source code of HidTest, it became obvious what the problem was. It doesn't use the same interface at all. It uses much more powerful driver APIs, while AHKHID only wraps the raw input API. It's a big difference.

The driver APIs can be used to query all the information about the device and actually communicate with it. That is why it is much more advanced (way above my head anyhow). From what I understand, the raw input model is an abstraction of this, allowing applications to easily receive data from 'user-oriented' devices. The raw input link above explains it in much more details.

So, to relate this to your issue, it is probable that the page the power button operates on is simply not accessible to (or 'caught' by) the raw input model. A hint of this is that it is placed in the Monitor pages, as opposed to other more obvious input-centric pages (like keyboard/mouse/vendor-specific).

To make sure this is not a problem with AHKHID, you can also try detecting it with Micah's script, which uses the same functions as AHKHID, but wrapped in a DLL.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 21st, 2011, 2:42 am 
Offline

Joined: January 15th, 2007, 2:37 pm
Posts: 573
TheGood wrote:
From what you've said, I also believe AHKHID should be able to detect it. This is rather hard to do without the ability to test it here, but I will look into it as much as I can.


Thanks, I appreciate your help with this. Funny you should answer this today.

I realized a couple of hours ago that AHKHID doesn't see my X10 Palm Pad remotes either. Of course it may be something completely different but it is sending input to the computer via usb. The transceiver is a CM15a. I can send X10 commands from AHK and yes EventGhost does see the incoming commands but not on the HID plugin, it has it's own X10 plugin so I was thinking it's not the same as an HID device.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 21st, 2011, 3:05 am 
Offline

Joined: January 15th, 2007, 2:37 pm
Posts: 573
Darn it. Micah's script doesn't see it either. :x I looked at the links and obviously they were waaayyy over my head. But I appreciate your figuring this out.

Btw, another funny thing about your responding today. I just got your AHKHID examples to a point where they save the remote information and autowrite the script. I have figured out how to have it find the ahk class of a window and save it and a prefix. The only thing I haven't figured out how to do yet is use multiple remotes. As of now only one HID device can be used. If I use another it overwrites the data of the first. But I'll keep working on it.

Thanks again for your help.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Google Feedfetcher, HotkeyStick, XstatyK, Yahoo [Bot] and 81 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group