6

On Windows 10, when I type Alt+Numpad1 it enters ☺ at the cursor. While I realize that this is an old function I would very much like to turn it off. I have no conceivable use for typing ☺, and it seems wasteful to lose so many useful shortcuts to something so trivial.

Is there any way to disable single-digit Alt codes for symbols such as (Alt+Numpad1: ☺, Alt+Numpad3: ♥, Alt+Numpad7: ◘) in order to use these as keyboard shortcuts instead?

Motivation: The numpad provides a very tempting set of options for assigning shortcuts in applications that allow modification of keyboard shortcuts. For example, I am running Rstudio Server inside Google Chrome, so I have a tabbed application inside of a tabbed browser, making Alt an attractive choice for shortcuts to navigate within Rstudio Server; the large number of panels make the numpad a great choice for navigating to panels.

xypha
  • 4,890
Patrick
  • 181

3 Answers3

1

Upon @xypha's advice I asked the question to AutoHotKey specialists.

On autohotkey.com was suggested to me the following script, which works like a charm.

Note however, it fails in Notepad; it will work only once. Afterwards all combinations will be disabled.

$!Numpad1::
$!Numpad2::
$!Numpad3::
$!Numpad4::
$!Numpad5::
$!Numpad6::
$!Numpad7::
$!Numpad8::
$!Numpad9::
$!Numpad0::Numpads .= "{" SubStr(A_ThisHotkey, 3) "}"
~LAlt Up::
IF StrLen(Numpads) > 9
    Send, {LAlt Down}%Numpads%{LAlt Up}
Numpads =
Return
1

AutoHotkey can help turn off ALT + Numpad keys or remap them to a more useful purpose.

  • Install AutoHotkey or extract the portable app to suitable location
  • Create an AHK file (I usually go to Desktop > Right click > New > AutoHotkey Script)
  • Modify the following lines as needed (in AHK v1) and add to AHK file
; lines beginning with semicolon (;) and characters appearing after a semicolon are considered as comments and are not executed
; some common key modifiers are ! for ALT, ^ for CTRL, # for WIN, + for SHIFT
; "!" modifier applies to any type of ALT key. For more specific remaps 
;   >!    is RAlt / right ALT
;   <!    is LAlt / left ALT
;   <^>!  is ALTGr (LControl & RAlt)

; Examples -

!Numpad1::Return ; = do nothing ; "return" disables the key combo !Numpad2::Send ^{Tab} ; = CTRL + Tab = switch tabs in a browser ; Send simulates key presses

  • Save the AHK file and run it in one of the following ways -
    • Move the file or create a shortcut to the file in startup folder %AppData%\Microsoft\Windows\Start Menu\Programs\Startup, so that your remapped key are enabled every time you login, or
    • Create a new task in Task Scheduler for more customized triggers, or
    • Run the AHK file manually by double clicking on it whenever you need it. I am not familiar with Rstudio. See AutoHotkey help for more information on how to remap and change the AHK file to suit your needs.

For additional software recommendations, post a question on SE's Software Recommendations website.

xypha
  • 4,890
1

You may use the free AutoHotkey.

The following example script will intercept the Windows Alt+Numpad1 and will send instead Alt+1 to the active window:

!Numpad1::Send, !1

You may add more lines to the script for the other Numpad keys. You may also limit its actions to specific executables.

After installing AutoHotKey, put the above text in a .ahk file and double-click it to test. You may stop the script by right-click on the green H icon in the traybar and choosing Exit. To have it run on login, place it in the Startup group at
C:\Users\USER-NAME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup.

Useful AutoHotkey documentation:

harrymc
  • 498,455