ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

IDEA: remap extra keyboard keys for other tasks

(1/2) > >>

noth(a)nk.you:
This is probably a quick thing to do in AHK, but I have not yet learned all the necessary commands so I'd really enjoy some help.  On to the task!

I own a MS Natural Ergonomic 4000 keyboard (stolen picture, click to zoom):
IDEA: remap extra keyboard keys for other tasks

The bundled software does not allow many changes, so I was thinking that I could use AHK to alter the functionality of a few things.  In particular, the zoom slider (in the middle) and the back/forward keys (at the bottom).

Firstly, the slider.  From AHK's Key History view (which is only showing the key strokes), I believe it works by sending Ctrl+Scroll wheel up/down every ~.1s or so.  Since zoom is not very useful to me, I'd prefer this combination be mapped to just the scroll wheel up/down.  Is this doable?

Secondly, the back/fwd keys.  My mouse is already equipped with such buttons so the keyboard is redundant.  Instead, I'd like these keys to map to left/right mouse buttons (a throwback to my lappy).  Again with AHK, I see these keys are mapped to Alt+Left/Right in the following way: Alt d, Left d, Left u, Alt u--but all sequenced without delay.  The problem I'm running in to with coding is translating this to the analogous mousing.  That is, I'd like to be able to hold down the back/fwd keys and drag files/folders.  Is this doable?
 (This is more useful than it sounds.)I've found that the mouse can be moved around more freely when the fingers are loose, so using the alternate hand to control the buttons makes repetitive mousing a breeze.  E.g. big file operations, simple Flash games, AutoCAD, etc.

I should also like to note that my mouse uses RightAlt+L/R, so there shouldn't be a conflict there if the script just recognizes LeftAlt. 
Thanks for reading, any help you can provide would be most appreciated.

Cheers,
noth(a)nk.you

P.S. Thanks for tolerating my playing with the spoiler tag!

jgpaiva:
EhEh.. So much text for such a small solution!


--- ---^WheelDown::WheelDown
^WheelUp::WheelUp

<!Left::Lbutton
<!Right::RButtonDoes that solve it? ;)

noth(a)nk.you:
Thanks a lot for your help, jgpaiva--it's close.

The scrolling wasn't working.  Ctrl was still down when AHK executed the Wheel commands, so (if anybody's interested) I changed it to

--- ---^WheelDown::Send {^Up}{WheelDown}
^WheelUp::Send {^Up}{WheelUp}Now it works pretty well, reverting back to the default behavior only when trying to scroll past the limits of the page (perhaps some timing issue?)

On the L/Rbuttons, though, I'm running into more trouble.

When pressing those keys in programs without "Back" support (e.g. Notepad and AHK), AHK reports:

--- ---A4  038 d 1.30 Alt
25  14B h d 0.00 Left
01  000 i d 0.00 LButton
25  14B h u 0.00 Left
01  000 i u 0.00 LButton
A4  038 u 0.00 Altand it works beautifully.

But in those programs with back support (e.g. Firefox and Explorer), AHK reports:

--- ---01  000 d 4.68 LButton
01  000 u 0.10 LButtonand the programs respond as though they were given the Back or Forward commands.

I'm thinking that the Back/Fwd commands might have some deeper hook into the OS?

Any thoughts?

Thanks,
noth(a)nk.you

jgpaiva:
Hum.. Then. it's harder than i thought.
How about the following, to replace the back/forward?


--- ---Browser_Back::Lbutton
Browser_Forward::RButton

noth(a)nk.you:
No, still getting just the LButton.
Interestingly, I get LButton for both the Back and Forward buttons.  Is that of some significance?

Navigation

[0] Message Index

[#] Next page

Go to full version