Keyboard Mapping Using AutoHotKey or Other Custom Windows Keyboard Shortcuts

[b]SYSTEM[/bt
Asus T100 10" Laptop
Windows 8.1
Foxit PDF Editor/Reader
AutoHotKey Software

BACKGROUND
When using Foxit PDF reader, I need to magnify the document's text. This means I must scroll or pan left and right to view all the text. Foxit does not have any keys to pan left and right. I would like to use the Left and Right Arrow Keys to pan left and right when using Foxit.

PROBLEM
Can someone help me to assign the desired behavior to the Left and Right Arrow keys by remapping the keyboard? Can you help me write the script using the AutoHotKey software? If you have another solution that works, I'd like to know about it as well. Can the remapping be in effect only when in Foxit?
Jerry LOperations ManagerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Joe Winograd, Fellow&MVEDeveloperCommented:
Hi Jerry,

> Foxit does not have any keys to pan left and right.

Yes, Foxit Reader does: Shift+LeftArrow and Shift+RightArrow.

> I would like to use the Left and Right Arrow Keys to pan left and right when using Foxit.

OK, that's doable with AutoHotkey.

> Can someone help me to assign the desired behavior to the Left and Right Arrow keys by remapping the keyboard?
> Can you help me write the script using the AutoHotKey software?

Yes, I should be able to get it to you in the next hour or two.

> Can the remapping be in effect only when in Foxit?

Yes, I'll make sure that such a feature is in my AutoHotkey script.

Regards, Joe
0
Joe Winograd, Fellow&MVEDeveloperCommented:
Hi Jerry,
Here's the AutoHotkey script that does what you want in Foxit Reader:

SetTitleMatchMode,2 ; match if title contains
SendMode Input ; faster and more reliable
#IfWinActive,Foxit Reader ; remap keys only in Foxit Reader
$Left::
Send +{Left} ; send Shift+Left when Left is pressed
Return
$Right::
Send +{Right} ; send Shift+Right when Right is pressed
Return

Open in new window

Regards, Joe
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jerry LOperations ManagerAuthor Commented:
Hi Joe,

Thanks for the script. I will take a look at it late tonight, or tomorrow.

FYI: Do I need to disable WIndows Hot Keys, change anything in Foxit, or any other such preparations?

I'll give it a try and let you know...

-Jerry
0
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

Joe Winograd, Fellow&MVEDeveloperCommented:
> Thanks for the script.

You're welcome!

> Do I need to disable WIndows Hot Keys

No.

> change anything in Foxit

No.

> or any other such preparations?

No.

> I'll give it a try and let you know...

Sounds good. Tested here in W7/64-bit with AutoHotkey Version 1.1.30.00 (Unicode 32-bit) and Foxit Reader Version 9.2.0.9297 — works perfectly! Btw, I just discovered that Up and Down already work in Foxit without the shift key, so I edited my posts and script above accordingly. Regards, Joe

Edits: (1) Changed the hotkeys in my script above to include the dollar sign modifier, which is necessary since each Send command is sending a key that comprises the hotkey itself (Left and Right). (2) Realized that my Foxit Reader is old (my AutoHotkey is current), so I just installed the latest Version 9.3.0.10826 — script works fine with that, too.
0
Jerry LOperations ManagerAuthor Commented:
Perfect. You saved me a ton of time and aggravation trying to learn how to write those scripts.

I also remapped Ctrl+Arrow to do what the default Foxit Arrows used to do, jump to next/prev page.

SetTitleMatchMode,2 ; match if title contains
SendMode Input ; faster and more reliable
#IfWinActive,Foxit Reader ; remap keys only in Foxit Reader
$Left::
Send +{Left} ; send Shift+Left when Left is pressed
Return
$Right::
Send +{Right} ; send Shift+Right when Right is pressed
Return
$^Left::
Send {Left} ; send Left when Ctrl+Left is pressed
Return
$^Right::
Send {Right} ; send Right when Ctrl+Right is pressed
Return

Open in new window

0
Joe Winograd, Fellow&MVEDeveloperCommented:
Hi Jerry,
Great job on adding the Ctrl+Left and Ctrl+Right keys. I tested your enhanced script here...works perfectly! Regards, Joe
0
Jerry LOperations ManagerAuthor Commented:
When I posted on FoxitSoftware's support forum about what I thought was the missing functionality, they did not mention Shift+Arrow key combo. Nor did I find it while searching on Google.  I'm happy to have discovered AutoHotKey. It may be useful in the future. And I like the way the script allows my own desired hot keys. Good to see you again, Joe.
0
Joe Winograd, Fellow&MVEDeveloperCommented:
> they did not mention Shift+Arrow key combo

I'm surprised that the Foxit Software support forum didn't come back with that...but glad we got it sorted for you!

> I'm happy to have discovered AutoHotKey. It may be useful in the future.

I'm confident that it will be. Hardly a week goes by where I don't write a few AutoHotkey scripts to automate some tasks. Even that word AutoHotkey in the last sentence came to you via an AHK hotstring...and the bolding and italics in this sentence via AHK hotkeys.

> I like the way the script allows my own desired hot keys.

Glad you like it. I have an AHK script in my Windows Startup folder that creates a gazillion hotkeys and hotstrings.

Regards, Joe
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Applications

From novice to tech pro — start learning today.