AutoHotkey Community

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

All times are UTC [ DST ]




Post new topic Reply to topic  [ 398 posts ]  Go to page Previous  1 ... 14, 15, 16, 17, 18, 19, 20 ... 27  Next
Author Message
 Post subject:
PostPosted: December 14th, 2010, 5:50 pm 
I definitely like the new version! Nice implementation of some potentially confusing stuff. Ok, so, you asked for suggestions and here are a couple more advanced suggestions if you care to work on it. I'm thinking of this as an all inclusive "perfect world" program. One shot, do everything kind of deal. And, seriously, just ideas. You have done a great service as it is!

1. An additional "advanced" tab (so as not to be confusing to new users) that lists the actual hex data sent out by the device (as in EX. 2) The up and down states of the data can be useful.

2. In this view it would also be nice to have a log view with potentially a slow down button. To essentially slowly display the data. I realize that is quite specific to a few devices but some use strings of button presses used in navigation type devices.


3. A not so advanced idea but more functional would be to include in your help file a template for new users. Similar to what thegood did but more explanatory. You have done well with instructions and I think you could write a "simple first button" script that the user can copy, put in their variables, and run and see their results work.If you were really ambitious, you could create a form that has check boxes (like you just created) that you check and the input gets put into the code in the correct places.

4. Just a "Handy" item, you could reference the keylist from AHK so inputting what you want the button to do would be simple to find. You could link ref this or include it in a tab http://www.autohotkey.com/docs/KeyList.htm

5. If we could get others to help, it would be great to have a library of key functions for specific programs that are most widely used. Winamp, VLC, itunes, WMP, ...etc And then the ultimate would be to have that function checkable to include into the script. So you could literally write the script by clicking what you wanted to do. Then copy and paste the entire code.

I would be happy to contribute if you are at all interested in going that far with it. Time is valuable commodity these days though, so it would be a work in progress.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 14th, 2010, 7:33 pm 
Offline

Joined: January 15th, 2007, 2:37 pm
Posts: 573
curious1 wrote:
I'm thinking of this as an all inclusive "perfect world" program. One shot, do everything kind of deal.

3. A not so advanced idea but more functional would be to include in your help file a template for new users.

4. Just a "Handy" item, you could reference the keylist from AHK

5. it would be great to have a library of key functions for specific programs that are most widely used.

I've started a new project that pretty well covers all these but it may take me a while to get a first draft working. I'll post and ask for suggestions and/or help as soon as I get enough organized.

curious1 wrote:
1. An additional "advanced" tab (so as not to be confusing to new users) that lists the actual hex data sent out by the device (as in EX. 2) The up and down states of the data can be useful.

2. In this view it would also be nice to have a log view with potentially a slow down button. To essentially slowly display the data. I realize that is quite specific to a few devices but some use strings of button presses used in navigation type devices.

The Advanced tab shouldn't be difficult and I can see where some people would need this info. I'm not sure how to do a slow down. Maybe a pause button so you can look over what's been logged while ignoring current info?

One question I have now, can the AHKHID.ahk be referenced as a library instead of using #include? I know in the script it says it must be included to use constants, which I'm not sure what the constants are.

As far as time, in my job I have a lot of time off and were entering the slow season, and with my health conditions I don't go anywhere when I am off so I plan on working on this for a while. But since I'm using the learn as you go method getting working scripts takes me a while.

I also have a bad habit of missing the simple solutions and taking the long route to get things done. For example I have one script with an elaborate system of making "pages" before I learned how to use tabs. Anywhere you could point things like this out to me would be appreciated.

Thanks for you input.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 15th, 2010, 2:51 am 
Offline

Joined: November 9th, 2008, 7:48 pm
Posts: 25
Blahman wrote:
Blahman wrote:
Hello all, been away from AHK for a long time, but I now would like to see if anyone can help with the following:

I have a Bluetooth trackball (MacMice "The Ball") that shows up as a HID-compliant mouse in Windows 7. It works great except a pretty nasty issue where it seems to be sending a scroll right and scroll down command (not sure which one as I understand there are several) with EVERY mouse movement poll. As you might expect this is very undesired behavior :P

So I am looking at AHK to see if I can filter out the erroneous messages. I am using Micha's DLL and his first example script to view the data the mouse is sending, and comparing it to what another, non-problematic, mouse is sending.

It looks like the Bluetooth trackball is sending a BtnFlag of 2048 and a ButtonData of 6720 where the normal mouse has 0 for those.

Is there any way to filter out that data or does anyone have any other ideas of what I can do?


So I went back to my old WinXP notebook to test why I never noticed this behavior with it, used Micha's DLL to inspect the data and on XP it sends BtnFlag and ButtonData of 0 -- what does that mean? Driver issue in Windows 7? Anyway, doubtful there is any updated drivers for this hardware as the manufacturer no longer sells it (great, unique product though).


So does anyone know how to filter out this bad data?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 15th, 2010, 7:06 am 
Offline

Joined: January 15th, 2007, 2:37 pm
Posts: 573
Blahman wrote:
So does anyone know how to filter out this bad data?


I had a thought but haven't had a chance to look and see if it feasible. Can the data be used as a g-label? If you assign a single key on the keyboard as a hotkey then the key is blocked from being seen by the operating system i.e. if you use x:: then you can no longer type the letter x. If the data could be assigned as a label or even a hotkey that does nothing then it may get blocked from the os.
Code:
BadData:
Return


Edit:
Oops, sorry. I just realized that this info is in the first post of the topic which is probably what brought you to this thread in the first place. Sorry but I don't have any other ideas.

TheGood doesn't seem to read this topic's replies anymore and he is likely the one who would know. He is still around and active in other threads. Have you asked this in the help section?


Last edited by specter333 on December 15th, 2010, 9:10 pm, edited 2 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 15th, 2010, 5:44 pm 
Specter333, sorry to hear about your health.
Quote:
can the AHKHID.ahk be referenced as a library instead of using #include? I know in the script it says it must be included to use constants, which I'm not sure what the constants are.


Yes. And maybe? haha. Yes it can be a library but you must put it in your library. I have mine here C:\Program Files\AutoHotkey\Lib If you do not have files in your library just create a Lib folder in the Autohotkey folder and drop AHKHID.ahk in there. Then to reference it you just use AHKHID_UseConstants() in your script instead of include.

If you meant like a .dll library, then yes, but that's a little beyond my scope. There are topics about dll's though.

That said, (and if you meant DLL) why? Once compiled, the scipts are transportable and fully functional. If you package the "project" just include AHKHID in the zip. If you need to add functions or variables, you could simply tack on to AHKHID.

So, in short, (and hopefully clearer answer to your question) AHKHID is basically a library, and the "constants" are the functions defined in AHKHID. So AHKHID_UseConstants() gives your script access to all of those functions defined in AHKHID in additon to anything you define in your script. It does, however assume or require the user to have that "library" in their system. BUT you will not have to have AHKHID (or any other that you put in your Lib folder) to be in the same directory as your script. It becomes globally accessible as long as it's referenced in the script.

The include statement is specific to the directory it resides in or you have to include the path to the file you want to include.
The _UseConstants statement is global so no path(but you have to have the "file" in your Lib)

A pause button would do the trick. I was thinking of some elaborate wait timer input delay, but as you said, sometimes it's the simple solutions that are best.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 15th, 2010, 9:02 pm 
Offline

Joined: January 15th, 2007, 2:37 pm
Posts: 573
Great that works, Thank you for the easy to understand definition. That is how I thought a library worked but I'm glad to have confirmation. Also since the notes said #include must be in the execute section I wasn't sure if doing the library reference would work. Also wasn't completely sure if this script even used the constants so didn't know if just doing the reference was a complete test.

A dll library is something I haven't even looked at yet, I have a looong way to go and a lot of studying yet to do. But to grasp the meaning of most of this I have to see it working, in other words (to quote someone, don't remember who) "Reading it to me doesn't do any good, Draw me a picture."

The reason I asked is the script I posted to give my wacom stylus a middle mouse click action. I copied it into the startup folder on my tablet but then had to change the #include to my library path. I wasn't sure if referencing it would work and didn't have time to read up on it. I compiled it to share with some other TC1100 user which includes the needed library functions... doesn't it?

My project today is to add the page for hex data and learn how (or if) to use hex data for my g-labels. First thing I'm going to do is look up the definition of hex data. :?

I have another HID input device I'm testing, a Nascar Racing Wheel that sends a lot of information but in different bytes of the number, all on one TLC. I can see all the codes by changing the +# in my script but I'm not sure how to use them all together in a script since I can only get input for a few at one time.

A lot of the time I spend studying is actually spent on finding the material I need to study. I do search terms in the AHK manual but that often brings a lot of results that aren't related. So if you, or anyone, could offer some suggestions on what I should read (or pictures to look at) I would appreciate it.

Thanks for your help and input.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 15th, 2010, 11:15 pm 
Offline

Joined: July 30th, 2007, 11:32 pm
Posts: 581
Sorry for my inactivity. Busy times...
I haven't read all the new posts, but to address a few of the issues discussed.

specter333 wrote:
One question I have now, can the AHKHID.ahk be referenced as a library instead of using #include? I know in the script it says it must be included to use constants, which I'm not sure what the constants are.

Yes. AHKHID can be used both ways:
- If you use #Include in the auto-execute section of your script, then you will have access to the constants automatically. There's no need to call AHKHID_UseConstants().
- If you don't use #Include (or if you used #Include but not in the auto-execute section), but have AHKHID in one of your library folders, then you can call AHKHID_UseConstants() if you want to use the constants.
Hope this made sense.

curious1 wrote:
I have entered
;Register mouse with RIDEV_INPUTSINK (so that data is received even in the background)
r := AHKHID_Register(12, 1, hGui, RIDEV_INPUTSINK)
If Not r { ;Check for error
MsgBox, Registration failed!`n%ErrorLevel%
ExitApp
}

AHKHID_Register() returns 0 on success, and -1 on error. Let me know if you got this from one of my scripts, because it's wrong! :oops:

curious1 wrote:
Question: How do I assign specific macro to the specific mouse (based on the info here and assuming it will register)

It is definitely possible to differentiate between two mice/keyboards. See Multiple mice cursors for an example.

Blahman wrote:
Is there any way to filter out that data or does anyone have any other ideas of what I can do?

This falls under the category of the bolded question in the first post. The bottom line is that AHKHID cannot stop a device from sending whatever message it wants to send.

specter333 wrote:
I really don't understand the verify code your using

Ideally, you should check what value AHKHID_Register() returns to see if the registration was successful. If it wasn't successful (returns -1), you can inform the user/take appropriate action.

specter333 wrote:
So if you, or anyone, could offer some suggestions on what I should read (or pictures to look at) I would appreciate it.

I'm happy to know that you want to learn! Maybe you could go through the tutorial (second post in this thread), step-by-step, and make sure you understand what's going on in each step. Even if you don't have a remote to play along with, it might be useful just to learn about AHKHID (or just AHK) in general. And if you have specific questions, you can ask! (if it's about AHK in general, it might be better to ask in the Ask For Help section).

Once the tutorial makes sense, start to look at the example scripts as well!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 15th, 2010, 11:44 pm 
Offline

Joined: January 15th, 2007, 2:37 pm
Posts: 573
Hello, I'm glad your still watching this topic.

TheGood wrote:
Maybe you could go through the tutorial (second post in this thread), step-by-step, and make sure you understand what's going on in each step. Even if you don't have a remote to play along with, it might be useful just to learn about AHKHID (or just AHK) in general. And if you have specific questions, you can ask! (if it's about AHK in general, it might be better to ask in the Ask For Help section).

Once the tutorial makes sense, start to look at the example scripts as well!

Just so happens I've been looking back through the tutorial and sample scripts over the last couple of hours while I try to figure out how to add the hex data to mine. Have your seen my combining of your scripts in an attempt to make this a little easier?
Code:
http://www.autohotkey.com/forum/viewtopic.php?t=41397&postdays=0&postorder=asc&start=234

Hopefully I'll get this to the point where anyone regardless of scripting knowledge will be able to use it. If you haven't seen it please take a look (time permitting) and let me know if you have any suggestions.

Thanks for the advice.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: multi mouse
PostPosted: December 16th, 2010, 1:47 am 
The Good, thanks for responding, and it was in a reply TheGood
PostPosted: Tue Jun 15, 2010 3:39 pm Post subject: Re: next step
Pg 14 of this thread. It sounded good to be able to verify and check for registration. Caused alot of frustration on my part. Thanks for letting me know. So, should I change the AHKHID.ahk to reflect that, or modify the line to If r {;...... just taking out the NOT? In my original, obviously it would exit the script, further implying it had not registered.

On the multi-mouse thing. Several issues:
1. Code is buggy, still uses HID_Register, HID_.....instead of the now used AHKHID_....definitions in your updated file. Had to correct those and the include line to get it to work. Then, I replaced the Mouse B code to use the x axis for B. That got it functioning.
2. Even though it bring up a window it doesn't consistently use Mouse A for one function and Mouse B for another. They often revert to using the same function again.
3. It is confined to a window and doesn't provide seperate pointers but rather an odd tiny numerated box that floats around.
4. Without exploring further, it does not seem to actually differentiate the mice. It seems more like emulating a curser and confining that cursor to a box that only allows one axis of movement.
5. The box with mouse movement, direction, and message boxes don't function. I uncommented but still no info. Could be syntax, I'll look closer later.

Don't get me wrong, it's neat what has been done. But I don't yet see individual functioning devices. I will look further and play with it to see what I can do, but I would consistent device specific usage. How do you determine mouse A from mouse B consistently? If you mapped a macro to mouse B how would you ensure it will always be Mouse B?

That said, I would LOVE to find a valid solution. I will update you guys on any progress with that.

Specter333 -glad I could help. I'll start responding to your thread on your particular revision of TheGood's ex 1&2. I like where it's going in terms of usability.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 16th, 2010, 3:52 am 
Offline

Joined: January 15th, 2007, 2:37 pm
Posts: 573
Ok, question about hex data. I started with the assumption that the input from the HID device was in hex and the making a script example converted to decimal. AHKHID_GetInputData also states that it gets raw data received from the device but the info I get from the example is decimal.

So, I don't think I'm getting decimal from the usb device so where is it being converted, in the driver? And is converting it back again the best way to get hex? Or am I just not seeing where it's being converted.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 16th, 2010, 5:17 am 
You are getting Binary.It's being converted by Lazlo's Binary to Hex code at the bottom of ex 2. I'll quote TheGood here in a response
Quote:
b0ring wrote:
I played around on variations of the "NumGet(uData, 5, "UChar")" in your code but the only way I could find unique numbers was using "NumGet(uData, 0, "UInt")" but these differ largely from the data reported back in Example 2, such as the blue button having an 8196 code instead of the reported data of 042000. Do you know if this a reliable and safe way of capturing the buttons, since it seems to work perfectly?

Don't forget that the data coming out of Example 2 is in hexadecimal. When you use NumGet, you're using its decimal value. This might explain the discrepancy between the two reported data (8196 in hex is 2004 which is what Example 2 gave, except the bytes go from left to right instead of right to left, ie. the leftmost byte is the first byte). What you could do is to modify Example 2 so that it gives out the decimal


binary (sorry if you already know) is the most basic machine code 0 and 1. Hex is the "hexadecimal" equivalent and easier to work with.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 16th, 2010, 5:27 am 
Sorry, that's not correct. I responded too quickly. I should have looked at the code first instead of going by memory. It's not 1 and 0 binary but actually the decimal equivalent of hex. You can see this yourself if you open calculator on windows, click on View, click Scientific, then click Dec on the left, which is obviously Decimal. Enter your decimal number and then click Hex, at the far left. You will see the conversion.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 16th, 2010, 10:38 am 
Offline

Joined: January 15th, 2007, 2:37 pm
Posts: 573
I realize I'm getting the decimal equivalent but I don't see where it' getting converted from hex or binary which is what I assume is being received over usb.

I thought it would be more efficient to have the script list the raw data instead of converting it to dec and back again. For now I'm just going to do the conversion.

I'll post the new version soon. Thanks again


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 16th, 2010, 2:35 pm 
Offline

Joined: January 15th, 2007, 2:37 pm
Posts: 573
Got a little sidetracked. I've edited my gui to get input from my Nascar Racing Wheel. My question is how do I use these dynamic labels without creating 255 of them for each function.
Image
For instance, Gas starts at 255 up and decrements to 0 as it's pushed. Is there a better way of making g-labels other than just making a bunch of them.
Code:
Gas255:
Return
Gas245:
Return
...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 16th, 2010, 6:04 pm 
I'll stab at this in hopes it will help. I will have to do some digging myself before I can say for sure.
My guess is though, that your pedals are using an axis movement based around a potentiometer. So think of a joystick that only moves from center to one direction. So you have 0-255 steps of movement. So it's probably not sending 255 keystrokes. Your program is probably interpreting the axis movement as individual keys.

I could be wrong, and I will look at this as soon as i have a chance, but I would suggest looking for joystick or acceleration capturing/mapping and see what you can find.

I'll let you know if I come across anything.


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 398 posts ]  Go to page Previous  1 ... 14, 15, 16, 17, 18, 19, 20 ... 27  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Stigg and 11 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