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,182
  • 4
  • 20
  • 39
Patrick
  • 181
  • 5
  • 2
    Yes, and four-digit Alt codes like ALT-0169 make sense. But why are Alt-1 to Alt-9 assigned to such useless purposes? – Patrick Jun 10 '20 at 18:17

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 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 
; use "<^>!" for ALTGr (without quotes), 
; use ">!" or "RAlt" for right ALT  (without quotes), 
; use "<!" or "LAlt" for left ALT  (without quotes)

; Examples - 

!numpad1::return ; "return" disables shortcut
!numpad2::send ^{Tab} ; simulates pressing CTRL + Tab to switch tabs in a browser
  • save AHK and run it in one of several 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 keys are enabled every time you login, or
    • you can create a new task in Task Scheduler for more customized triggers, or
    • run the AHK 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 https://softwarerecs.stackexchange.com/

xypha
  • 4,182
  • 4
  • 20
  • 39
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
  • 455,459
  • 31
  • 526
  • 924
  • 1
    God bless you, I've been looking for an answer to this for years, it's almost 2 or 3 years since this problem started in Windows 11, and I have finally got it fixed. This is the right solution for this problem, it doesn't print annoying emojis and the keyboard shortcuts alt+0-9 are still working. I'm using these keyboard shortcuts for other things, and whenever I pressed it it printed emoji to the editor. Thank you , I'm super happy about this. – Silver Zachara Jun 26 '23 at 06:12
  • So it's not perfect, all other alt codes stopped working, eg. I can't write alt+0244 or alt+0228 anymore. The fix for this doesn't look simple, it should detect subsequential keypresses I think. At least would be good to know how to skip the above workaround for some alt code. – Silver Zachara Jun 26 '23 at 07:32
  • @SilverZachara: alt+0244 works for me with this script. AHK alone cannot explain such a problem. – harrymc Jun 26 '23 at 07:36