Keyboard Mapping Using AutoHotKey or Other Custom Windows Keyboard Shortcuts

Jerry L
Jerry L used Ask the Experts™
on
[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?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018

Commented:
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
Developer
Fellow 2017
Most Valuable Expert 2018
Commented:
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
Jerry LOperations Manager

Author

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
Exploring SharePoint 2016

Explore SharePoint 2016, the web-based, collaborative platform that integrates with Microsoft Office to provide intranets, secure document management, and collaboration so you can develop your online and offline capabilities.

Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018

Commented:
> 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.
Jerry LOperations Manager

Author

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

Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018

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

Author

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.
Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018

Commented:
> 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

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial