Avatar of Jerry L
Jerry L
Flag for United States of America asked on

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?
Microsoft ApplicationsSoftware* Keyboard MappingWindows OSAutoHotkey

Avatar of undefined
Last Comment
Joe Winograd

8/22/2022 - Mon
Joe Winograd

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
ASKER CERTIFIED SOLUTION
Joe Winograd

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Jerry L

ASKER
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
Joe Winograd

> 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.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
Jerry L

ASKER
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

Joe Winograd

Hi Jerry,
Great job on adding the Ctrl+Left and Ctrl+Right keys. I tested your enhanced script here...works perfectly! Regards, Joe
Jerry L

ASKER
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.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Joe Winograd

> 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