| View previous topic :: View next topic |
| Author |
Message |
TheGood
Joined: 30 Jul 2007 Posts: 580
|
Posted: Sun Jun 21, 2009 3:09 pm Post subject: |
|
|
What you need is some kind of filtering.
I am working on a modified version of Example 2 that will allow this, but for now you'll have to do it yourself (I doubt I'll be releasing it anytime soon). It shouldn't be too hard. You'll have to add a code section in the InputMsg that will discard messages based on certain criteria, which you'll have to determine.
Don't forget that you can deregister devices. Therefore, what you might want to do is to register the device, and then prep the deregister call and keep the mouse on the Call button. And then click it as soon as you press a button on your HID. This way, the press should be near the bottom of the input list. |
|
| Back to top |
|
 |
bxr
Joined: 07 Mar 2009 Posts: 9
|
Posted: Wed Jun 24, 2009 11:01 am Post subject: Re: MCE remote - How do you make AHKHID pressed exclusive? |
|
|
Tried it. It requires restart of the system though.
The problem is that it doesn't allow to catch the presses in AHKHID as well or am I missing something here? |
|
| Back to top |
|
 |
TheGood
Joined: 30 Jul 2007 Posts: 580
|
Posted: Thu Jun 25, 2009 7:15 pm Post subject: Re: MCE remote - How do you make AHKHID pressed exclusive? |
|
|
| bxr wrote: | Tried it. It requires restart of the system though.
The problem is that it doesn't allow to catch the presses in AHKHID as well or am I missing something here? |
What bidomo showed you is only to disable the keypresses generated by the remote. You can now capture the buttons with AHKHID in the same way I showed in the tutorial. |
|
| Back to top |
|
 |
Xizzzy
Joined: 06 Jun 2009 Posts: 9 Location: Here
|
Posted: Fri Jun 26, 2009 3:27 am Post subject: Raw Data |
|
|
Ive managed to find the raw data for each of the other parts on the Joystick. I'd like to be able to use them to make certain functions active and others silent for example if the tuner dial is set to "11" Joy12 brings up firefox but if Tuner dial is set to "22" Joy12 would bring up a windows calculator. In short I'm not really sure where to go next from here.
 _________________ In the beginning the Universe was created.
This has made a lot of people very angry and has been widely regarded as a bad move. |
|
| Back to top |
|
 |
TheGood
Joined: 30 Jul 2007 Posts: 580
|
Posted: Fri Jun 26, 2009 1:59 pm Post subject: Re: Raw Data |
|
|
| Xizzzy wrote: | | I'd like to be able to use them to make certain functions active and others silent for example if the tuner dial is set to "11" Joy12 brings up firefox but if Tuner dial is set to "22" Joy12 would bring up a windows calculator. In short I'm not really sure where to go next from here. |
There are different ways you can do this. As long as you're able to detect in which position the dial is, you shouldn't have any problem. The obvious thing you could do here is, in your InputMsg() function, keep a global variable up-to-date with the position of the dial. And then in your sub for Joy12, simply use a set of Ifs to do different actions depending on the value of the global variable. |
|
| Back to top |
|
 |
Xizzzy
Joined: 06 Jun 2009 Posts: 9 Location: Here
|
Posted: Sat Jun 27, 2009 6:55 pm Post subject: Making progress |
|
|
So far Ive been able to get responses from the input codes I have and things are progressing smoothly. However, do I need two scripts to have the input recognized and acted on from 2 different positions in the code. If I'm having it keep an eye on the 7th byte do I need a separate script to also keep an eye on the 15th byte as well? Also how would I go about setting up the Global that could keep up to date on the position of the dial and then how would I set up the script to act differently from the button the ifs are simple enough but using "Default_0" as if it were a part of the "send {enter}" commands doesn't seem to work. I'm probably missing something with that but I'm still fairly new to autohotkey so I'm learning as I go =3
Furthermore, if I do have one script that can act depending on how two byte positions are can I have them act together?
ie. if byte 5 is decimal value 12 and byte 7 is decimal value 16 how would I setup a script to use the value of byte 5 to control the result from byte 7 _________________ In the beginning the Universe was created.
This has made a lot of people very angry and has been widely regarded as a bad move. |
|
| Back to top |
|
 |
bidomo
Joined: 05 Feb 2009 Posts: 59
|
Posted: Fri Jul 03, 2009 1:01 am Post subject: |
|
|
| That joystick looks very cute, I'll try to get one |
|
| Back to top |
|
 |
Xizzzy
Joined: 06 Jun 2009 Posts: 9 Location: Here
|
Posted: Tue Jul 07, 2009 10:52 am Post subject: Lights and HID |
|
|
I've got the basic idea behind the methods to use my HID device with your methods and I thank you for them ^_^ I still have a few other concepts to learn at this point about using two different bytes together to produce separate results but that can wait I think. Now, I'd like to tap into the ability to control the lights that are under the buttons =) The method below is written by the guy who created the drivers that allow me to use this Joystick on my PC instead of where its supposed to be used on an Xbox. The problem is I have absolutely no idea where to begin even trying to make that work =\
Also Thx I love my Joystick its a lot of fun ^_^ although the original game wasn't that great to be honest. _________________ In the beginning the Universe was created.
This has made a lot of people very angry and has been widely regarded as a bad move. |
|
| Back to top |
|
 |
TheGood
Joined: 30 Jul 2007 Posts: 580
|
Posted: Thu Jul 09, 2009 3:21 pm Post subject: |
|
|
I'm glad you're figuring stuff out!
Unfortunately, AHKHID is only meant to receive data from HID devices. It doesn't have the ability to actually communicate with the device, which is what you're looking to do. I have no idea how that would work.
Try posting in the Ask For Help section and see if anyone can translate the code to AHK for you! |
|
| Back to top |
|
 |
evandevon
Joined: 22 Apr 2008 Posts: 82
|
Posted: Tue Jul 21, 2009 11:52 am Post subject: Dream Cheeky USB Roll Up Drum Kit |
|
|
I'm a special ed teacher and bought this roll up drum kit
http://www.dreamcheeky.com/index.php?pagename=product&pid=33
So i could not only use it in class as it is but also however the heck I want to so I can meet the needs of my students. I needed to be able to program whatever sounds/keys/mouse moves etc I wanted so here is my first test script. (still need to have AHKHID.ahk in the same directory)
I was surprised when it wasn't recognised as a joystick. Also, I don't fully understand everything that's going on in this script but it works so far.
| Code: |
;Must be in auto-execute section if I want to use the constants
#Include %A_ScriptDir%\AHKHID.ahk
;Create GUI to receive messages
Gui, +LastFound
hGui := WinExist()
;Intercept WM_INPUT messages
WM_INPUT := 0xFF
OnMessage(WM_INPUT, "InputMsg")
;Register Remote Control with RIDEV_INPUTSINK (so that data is received even in the background)
d := HID_Register(65440, 1, hGui, RIDEV_INPUTSINK)
Return
InputMsg(wParam, lParam)
{
Local devh, iKey, sLabel
Critical
;Get handle of device
devh := HID_GetInputInfo(lParam, II_DEVHANDLE)
;Get data
HID_GetInputData(lParam, uData)
iKey := NumGet(uData, 0, "UInt")
sLabel := "Drum" . iKey
if (ikey > 0 AND ikey = 2048 OR ikey = 512 OR ikey = 4096 OR ikey = 1024 OR ikey = 8192 OR ikey = 256)
Gosub, %sLabel%
;msgbox, %sLabel%
}
Drum2048:
soundplay, fart1.wav
return
Drum512:
soundplay, fart2.wav
return
Drum4096:
soundplay, fart3.wav
return
Drum1024:
soundplay, fart4.wav
return
Drum8192:
soundplay, fart5.wav
return
Drum256:
soundplay, fart6.wav
return
|
The sound effects are a bit "cheeky" (I'm sorry for that one...) but they are just the beginning!
Here's a zip with the "hole" package (teeheehee)
http://www.autohotkey.net/~evandevon/Drumkit%201.zip
Download this and take it around on a usb key so that you don't need to install the drivers/software for this thing. _________________ Inventing problems that need solutions...
Open Communicator
MouseTrainer |
|
| Back to top |
|
 |
Big Digger
Joined: 07 Feb 2009 Posts: 43
|
Posted: Mon Aug 10, 2009 5:49 pm Post subject: |
|
|
I bought multimedia IR remote controller with USB receiver
6 new items appears in the Device Manager right after connecting USB receiver
This remote control operates both the keyboard and mouse | Code: | /*
http://img142.imageshack.us/img142/8342/remote.png
+--------------------+--------------------+--------------------+
| Remote key | Keyboard mode | Mouse mode |
+--------------------+--------------------+--------------------+
| power | Power button |
+--------------------+-----------------------------------------+
| close | LAlt + F4 |
+--------------------+-----------------------------------------+
| tv/dvr | LCtrl + LShift + LAlt + 2 |
+--------------------+-----------------------------------------+
| print | LCtrl + LShift + LAlt + H |
+--------------------+-----------------------------------------+
| music | LCtrl + LShift + LAlt + 3 |
+--------------------+-----------------------------------------+
| dvd/menu | LCtrl + LShift + LAlt + 1 |
+--------------------+-----------------------------------------+
| pictures | LCtrl + LShift + LAlt + 4 |
+--------------------+-----------------------------------------+
| videos | LCtrl + LShift + LAlt + 5 |
+--------------------+--------------------+--------------------+
| | Up | |
| joystick | Left Right | Move mouse pointer |
| | Down | |
+--------------------+--------------------+--------------------+
| back | Browser Back | Left mouse button |
+--------------------+--------------------+--------------------+
| tab | Tab | Right mouse button |
+--------------------+--------------------+--------------------+
| ok | Enter |
+--------------------+-----------------------------------------+
| play/pause | LCtrl + P |
+--------------------+-----------------------------------------+
| stop | LCtrl + S |
+--------------------+-----------------------------------------+
| prev | LCtrl + B |
+--------------------+-----------------------------------------+
| next | LCtrl + F |
+--------------------+-----------------------------------------+
| rew | LCtrl + LShift + B |
+--------------------+-----------------------------------------+
| fwd | LCtrl + LShift + F |
+--------------------+-----------------------------------------+
| vol + | Volume Up |
+--------------------+-----------------------------------------+
| vol - | Volume Down |
+--------------------+-----------------------------------------+
| mute | Volume Mute |
+--------------------+-----------------------------------------+
| ch + | Page Up |
+--------------------+-----------------------------------------+
| ch - | Page Down |
+--------------------+-----------------------------------------+
| home | LCtrl + LShift + LAlt + Home |
+--------------------+-----------------------------------------+
| rec | LCtrl + R |
+--------------------+-----------------------------------------+
| toggle | Toggle between keyboard and mouse modes |
+--------------------+-----------------------------------------+
| 0...9 | 0...9 |
+--------------------+-----------------------------------------+
| shuffle | LCtrl + LShift + LAlt + F |
+--------------------+-----------------------------------------+
| repeat | LCtrl + LShift + LAlt + B |
+--------------------+-----------------------------------------+ |
Example 1 script
Example 2 script
I'm getting data for only 4 buttons and nothing for all others
What am I doing wrong? Any help appreciated
Last edited by Big Digger on Tue Aug 18, 2009 8:56 am; edited 1 time in total |
|
| Back to top |
|
 |
TheGood
Joined: 30 Jul 2007 Posts: 580
|
Posted: Mon Aug 10, 2009 10:29 pm Post subject: |
|
|
Big Digger,
As you noticed yourself, the remote is seen as a keyboard, a mouse, and an "Other" HID device. It is completely possible for the remote to use the UsPg/Us 12/1 only for a few buttons and keyboard combinations for the other buttons. This happened in the remote I showed in the tutorial, where UsPg/Us 12/1 only covered some buttons. What you'll need to do is to intercept the input messages that the remote sends as keyboard presses. This means that you'll also face the problem ddh819 faced, with possible solutions here and here (with more details here).
Hope this helps! |
|
| Back to top |
|
 |
darkdeathrip
Joined: 26 Aug 2007 Posts: 8
|
Posted: Wed Aug 12, 2009 9:09 pm Post subject: thanks |
|
|
| thank you for this nice and clean solution! i will try to use it with my remote, as soon as my remote script is working i will post it here! |
|
| Back to top |
|
 |
tyxiang
Joined: 26 Nov 2008 Posts: 12
|
Posted: Wed Sep 09, 2009 4:30 am Post subject: HELP |
|
|
This is my remote control:
The remote control add in a HID device (remote control receiver) and a JoyStick to my PC. Like this:
The script can get code from Joystick (Usage=5 and UsagePage=1).
But it can not get anything from the remote control receive (Usage=0 and UsagePage=65280).
can someone give me some advice?
thank you a lot. |
|
| Back to top |
|
 |
barty
Joined: 30 Aug 2009 Posts: 10
|
Posted: Wed Sep 09, 2009 5:55 pm Post subject: |
|
|
Thanks to TheGood et al. I got this working with my Logitech MX3200 kbd. I'll post my little script later.
I have a problem though:
Is there a way to "eat" a key. Certain keys will fire an action in Windows even though I am not using Logitech's software. These are the "common" extended keys like search computer or media keys like play and mute. Sometimes, this is ok but sometimes I want to completely override and define my own action.
any input appreciated, and thanks again for the great script. |
|
| Back to top |
|
 |
|