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
beermatt
  • Guests
  • Last active:
  • Joined: --

Hi,
I've uploaded version 1.01.
You can receive the devicenumber which generates an event.
Please have a look at the sample-script.

Many thanks Micha - in my excitement I initially overlooked the following messages (about mfc dll files) and wondered why it didn't work.. :oops:
Once I'd installed them it appears to work fine (by copying and modifying the code in the sample script which is different to your post above i.e. using DllCall GetNumberFromHandle rather than an additional parameter in DllCall GetWM_INPUTHIDData).

Many thanks :!:

Matt

Kellianjaxon
  • Guests
  • Last active:
  • Joined: --
First of all, thanks to Micha for making it possible to reprogram HIDs. Awesome work!

I'm having a few problems with my Logitech UltraX Media Remote, though. There are couple of buttons the "Vals" of which seem to be changing depending on the order of buttons pressed. I noticed this behaviour quite soon once I started trying to reprogram the remote.

Here's an example:

There's a button labeled Home that creates Vals 54480000 when pushed down right after the RemoteControl.ahk script has been loaded. If I push the button next to Home (= labeled Close), it gives me Vals 51535352. Now that I repush Home, I'll get 54480052.

After some experimenting it seems that four different buttons seem to get the last two digits (in previous example "52") from the button previously pressed. The funny thing is that this behaviour doesn't occur with all the buttons which at first made me believe the problem is in my remote. On the other hand I find it hard to believe that some buttons would be initially programmed by Logitech to react different ways dependable on the order.

I wonder if it's something I've to live with or if there's some way to tweak the code to reliably recognize the problematic buttons. Unfortunately I'm not experienced enough myself to participate in coding, just wanted to bring up the issue.

Should this become resolved, I can finish the PDF document I've made plus few other files - all about reprogramming UltraX Media Remote, upload them somewhere and post the link here for others to enjoy, too.

dhrto
  • Guests
  • Last active:
  • Joined: --
Hi there.

I too have experimenting with Mischa's dll and the UltraX remote. And I've run into the same situation as Kellianjaxon. Here's how I tackled the problem: note down the different Vals for the same button and just make it refer to the same sub in the script. Hope this helps.

grom
  • Guests
  • Last active:
  • Joined: --
Hi!

On my system the script generates the same error ( GetDeviceCount fehlgeschlagen. Errorcode: -3) after installing all these Visual C++ dlls. Dependancy Walker creates the following Warning about mpr.dll: At least one module has an unresolved import due to a missing export function in a delay-load dependent module. Could you explain what does this error mean and how to prevent it?

Micha
  • Members
  • 539 posts
  • Last active: Dec 31 2011 01:43 PM
  • Joined: 15 Nov 2005
Hi Kellianjaxon and dhrto,
I will have a look if I can find the problem.
Sorry but it can last a little bit. I have to sort 2100 pictures of our honeymoon and about 11 hours of video to cut from Kenya :-)
But I will not forget to find this error / problem :-)

Hi grom,
mpr.dll is red and this is "ok" in the helpfile of dependency walker this is explained. If it still doesn't work please read the posts of the thread:
http://www.autohotke...=asc&highlight=

Most users does not have the correct dlls or something is missing. Please verify that you have ALL dlls at the correct places.
If it still does not work, please install the VCRedist-Files mentioned in the thread
Ciao
Micha

BoBo
  • Guests
  • Last active:
  • Joined: --

I have to sort 2100 pictures of our honeymoon

8)Posted ImageCPosted Imagengrats!:D8)Posted Image:DPosted ImagePosted Image:D:)

holomind
  • Members
  • 341 posts
  • Last active: Aug 23 2015 03:27 PM
  • Joined: 11 Mar 2006

I have to sort 2100 pictures of our honeymoon

8)Posted ImageCPosted Imagengrats!:D8)Posted Image:DPosted ImagePosted Image:D:)


then you could have use of this:
http://www.cs.umd.edu/hcil/photomesa/

very cool way to find and categorize your images, seems you have lots of them ;)

timtyler
  • Members
  • 17 posts
  • Last active: Jan 25 2007 02:49 PM
  • Joined: 01 Jan 2007
This thread is a bit technical :-|

I have some questions about whether this can be used to
distinguish between additional numeric keypads.

Has anyone tried this? Is the returned DeviceHandle different
between different keypads? What about keypads that are
otherwise totally identical? Is the DeviceHandle persistent
across reboots, and across rearranging USB devices?

As has been discussed elsewhere, it would be great to be
able to address different keypads as different devices, without
having to spend the extra money on programmable keyboards.
--
__________
|im |yler http://timtyler.org/[email protected] Remove lock to reply.
--
__________
|im |yler http://timtyler.org/[email protected] Remove lock to reply.

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

This thread is a bit technical :-|

Well, yes it is, because the Windows-API for that is difficult :-)

I haven't tried different keypads. I only own the one on my standard-keyboard :-)
And I do not have two identical devices to test the behavior of windows.
The dll only wrapes the api for ahk. The behavior depends on windows.

Therefore I can't give you any hints.
You have to try and hopefully didn't fail.
Ciao
Micha

dan gii
  • Members
  • 1 posts
  • Last active: Mar 04 2007 12:40 AM
  • Joined: 16 Jan 2007
hey, im new to AutoHotkey and scripting all together... I managed to turn my Wingman Joypad into a Transport Controller for my music program though, but that was mostly looking at other resources available and modifying a little... must say, champion effort for creating this program and all the hard work along with it... especially the interaction with the users on the forum...

i was wondering if anyone can help me, ive got the "AutoHotkeyRemoteControlDLL.ahk" running at the moment and I want to get Two Keyboards to act independantly...

i want to use one to control functions in Ableton Live which can have key combinations set, like Ctrl+1 to record on the first track...

the other i want to use just as a normal keyboard

i get messages from two different devices when I register one of the Keyboards in the "AutoHotkeyRemoteControlDLL.ahk" gui. So at the moment, when i register one of the keyboards listed and I hit A on device 3 i get exactly the same messages in the area bellow when I hit A on device 5 (both are keyboards).

So basically, I want device 3 to be the keyboard I assign to controls like Ctr+1 etc. and I want device 5 just to be the normal keyboard....

Can anyone help with with the beggining of a script, even just to show me how i might map my keyboard on device 3 to have say the "1" key map to ctrl+1, the "Q" key to ctrl+q and maybe one of the function keys "F1" to map to ctrl+F

i would be so appreciative as this would get me further than where im at now and i could start mapping the rest of the keys as required.

think its possible?

thanks for reading.

dan.

Barney9
  • Members
  • 62 posts
  • Last active: Oct 09 2015 09:13 AM
  • Joined: 02 Mar 2007
Hi all!

I am using this script with my Logitech Mouse. I had to uninstall the Logitech drivers first in order to get the script receive events from all buttons. Unfortunately I receive the same codes for some buttons. So my script can't differ which button was pressed. I wonder how the Logitech software was able to differ the buttons.

Has somebody an idea how I can get it working?

Tim Tyler
  • Guests
  • Last active:
  • Joined: --
I tried it. Apparently I have 22 HID devices ;-)

After adding code in the demo script to print %DeviceNumber%,
I was mostly able to distinguish between the same key being pressed
on three different numeric keypads.

This is /potentially/ good news for those wanting a cheap way to obtain extra programmable keys - /without/ splashing out on a programmable keyboard.

However, the value returned in %DeviceNumber% proved not to be 100% reliable. I /suspect/ this is not a show-stopping problem -
but it looks like it may well be an irritation.

I have not explored what happens to %DeviceNumber% when the
machine is rebooted, or when USB devices are plugged/unplugged.

I also tried an unprogrammed X-Keys device. No juice - keypresses
produced no response.
--
_________
|im |yler http://timtyler.org/[email protected] Remove lock to reply.

Tim Tyler
  • Guests
  • Last active:
  • Joined: --

However, the value returned in %DeviceNumber% proved not to be 100% reliable. I /suspect/ this is not a show-stopping problem -
but it looks like it may well be an irritation.


To clarify, eack keypress produces two events. One always has the 'correct' device number. The other sometimes produces 0.
0 can be produced on either event. It happens about one time in twenty.

So: not a show-stopper - but a bit of an irritation.
--
_________
|im |yler http://timtyler.org/[email protected] Remove lock to reply.

Abhinav Jain
  • Members
  • 17 posts
  • Last active: Sep 02 2015 09:21 AM
  • Joined: 23 May 2015

Help!!!!

 

I want F2 key to function like Fn+F2 and Fn+F2 to function like F2.

I have a laptop in which pressing F2 key dims the brightness. I made the following script to reverse the functionality:

 

Brightness_Down::F2

F2::Brightness_Down

 

However, this is not the correct terminology for brightness changing.

Can you please tell me how to circumvent this.

 

I also tried the keyboard hook (in another laptop): where pressing F2 key gives the relevant key id. but pressing Fn + F2 (for dimming brightness) does not give any key id in key history. Also, I could not find the specific name for this feature. I found names like Volume_Down, Volume_Up, Volume_Mute on the internet and they were working in the script but Brightness_Down is not working.

 

P.S. I don't want to change BIOS settings to reverse all the function keys.

 

Regards