[0.C-3850] Key config and navigating menus with numpad

As someone who uses the numpad to navigate around in CATA; having to take your hands off of the numpad in order to scroll various menus tends to be very troublesome and tedious. Here are a few issues that i’ve noticed with inconsistencies related to the menus and key bindings for CATA. Some of these issues have persisted for years, while some of them seem like they are just related to older menus that have not been fully updated to the newer standards.

For anyone who might find it useful, at the bottom of this post is an AutoHotKey script which may help some people who are experiencing similar problems. Its not perfect however.

View Nearby Items Menu: (All working as intended)

Numpad and arrow keys scroll up and down.

Item Compare Menu: (All working as intended)

Left arrow or Numpad 4 = Switch rows
Right arrow or Numpad 6 = Select items

Inventory Menu: (All working as intended)

Left arrow or Numpad 4 = Switch rows
Right arrow or Numpad 6 = View items

Inventory Item View Menu: (Items dont seem to use numeric hotkeys in this menu? Numpad should navigate instead?)

Left arrow = Go back to inventory
Right arrow = Activate currently selected task (Easy to have undesirable actions due to inconsistency between different menus.)
Numpad 4 = Exit inventory entirely (Tries to hotkey, fails, exits menu. Should navigate instead?)
Numpad 6 = Exit inventory entirely (Tries to hotkey, fails, exits menu. Should navigate instead?)

Drop Menu: (Can numbers still be assigned as hotkeys for items? Maybe a general config option not to assign numbers to items so that numpad can be used to navigate?)

Left arrow = Switch rows
Right arrow = Select item
Numpad has no navigation function in this menu.

Examine Menu: (Desired functions would emulate arrow keys, plus allow Enter to confirm.) (Menu needs [?] hotkey reassignment?)

Left arrow = Unmark
Right arrow = Mark
Numpad has no navigation function in this menu.

Sleep Menu:

Arrow keys move selection
Numpad has no function in this menu.
Escape key wont exit this menu, must press y/n/arrows/enter.

Wait Menu:

Arrow keys move selection
Some selections are assigned numpad hotkeys (Optionally, consider assigning them a non-numeric key and allowing numpad navigation?)
Escape key wont exit this menu, must press hotkey to exit.

Advanced Inventory Menu:

Arrow keys move selection
Numpad selects which tile items get moved into. (Maybe allow Shift+Numpad keys to navigate or change floor locations here?)

Menus that cannot be exited with Escape or Spacebar:

(|) Wait menu
($) Sleep menu
(?) Help menu (Cant be exited with space bar.)

I’ve written a small AutoHotKey script which helps to correct some of these issues by binding the Numpad to function as Arrow keys because Numpad support is somewhat inconsistent in Cataclysm.

Requires AutoHotKey from http://ahkscript.org/

After installing AHK, Copy and paste the following code into a new PLAIN TEXT file, save it, and rename it to CataclysmDDA.ahk. Double click the script to run it.

MsgBox, 262144, Cataclysm DDA Numpad Fixer,
	- IMPORTANT NOTE: This script is now active. You may close this box. `n
	- -----------------------------------------------------              `n
	- While running, this script remaps the Numpad to function as arrow keys. `n
	- Press CTRL+Insert to disable the script at any time.               `n
	- Close script by right clicking the green icon in the system tray.  `n
	- ----------------------------------------------                     `n
	- Remapped: Numpad 8 = Arrow Up                                     `n
	- Remapped: Numpad 2 = Arrow Down                                   `n
	- Remapped: Numpad 4 = Arrow Left                                   `n
	- Remapped: Numpad 6 = Arrow Right                                  `n
	- ----------------------------------------------                     `n
	- Remapped: CTRL + Numpad 4 = < (Switches Menu Tabs, Stairway Up)   `n
	- Remapped: CTRL + Numpad 6 = > (Switches Menu Tabs, Stairway Down) `n
	- ----------------------------------------------                     `n
	- Tested with Cataclysm DDA - [0.C-3850] - 2015-11-05                `n

; Gives Numpad the same function as arrow keys in CataclysmDDA (Allows use of Numpad in most menus, breaks Advanced Inventory Menu.)
; For Advanced Inventory (Use 1-0 on the keyboard side to select ground positions instead or temporarily turn off script with CTRL+Insert.)

!Ins::Suspend				; CTRL + Insert (Disables hotkeys)

 Numpad8::SendInput, {Up}
 Numpad2::SendInput, {Down}
 Numpad4::SendInput, {Left}		; Change Menu Sides / Go back to Inventory (in Detailed Item View Mode)
 Numpad6::SendInput, {Right}		; Tick Menu Items   / Activate Item        (in Detailed Item View Mode)

^Numpad4::SendInput, {<}		; CTRL + Num 4 Functions as < (Switches Menus, Stairway Up)
^Numpad6::SendInput, {>}		; CTRL + Num 6 Functions as > (Switches Menus, Stairway Down)