This Script Will Disable Shift+Numpad Behavior! (v1)

Post your working scripts, libraries and tools.
imkira3
Posts: 84
Joined: 10 Jan 2023, 13:57
Contact:

This Script Will Disable Shift+Numpad Behavior! (v1)

Post by imkira3 » 08 Feb 2023, 10:27

This script will disable Shift+NumLock Behavior, so for example Shift+Numpad1 will now act as Numpad1 and Shift+NumpadEnd will act as NumpadEnd. It's a bit slow, but for a v1 it's not bad. Check it out!

Code: Select all

NumpadDel::{
if GetKeyState("NumLock", "T")
{
A_OGWindow := WinActive("A")
WinActivate "ahk_class" "Shell_TrayWnd"
try WinActivate A_OGWindow
Sendinput "{NumpadDot}"
}
else
Sendinput "{NumpadDel}"
}
<+NumpadDel::numpaddel

NumpadIns::{
if GetKeyState("NumLock", "T")
{
A_OGWindow := WinActive("A")
WinActivate "ahk_class" "Shell_TrayWnd"
try WinActivate A_OGWindow
Sendinput "{Numpad0}"
}
else
Sendinput "{NumpadIns}"
}
<+NumpadIns::numpadins

NumpadEnd::{
if GetKeyState("NumLock", "T")
{
A_OGWindow := WinActive("A")
WinActivate "ahk_class" "Shell_TrayWnd"
try WinActivate A_OGWindow
Sendinput "{Numpad1}"
}
else
Sendinput "{NumpadEnd}"
}
<+NumpadEnd::numpadend

NumpadDown::{
if GetKeyState("NumLock", "T")
{
A_OGWindow := WinActive("A")
WinActivate "ahk_class" "Shell_TrayWnd"
try WinActivate A_OGWindow
Sendinput "{Numpad2}"
}
else
Sendinput "{NumpadDown}"
}
<+NumpadDown::numpaddown

NumpadPgDn::{
if GetKeyState("NumLock", "T")
{
A_OGWindow := WinActive("A")
WinActivate "ahk_class" "Shell_TrayWnd"
try WinActivate A_OGWindow
Sendinput "{Numpad3}"
}
else
Sendinput "{NumpadPgDn}"
}
<+NumpadPgDn::numpadpgdn

NumpadLeft::{
if GetKeyState("NumLock", "T")
{
A_OGWindow := WinActive("A")
WinActivate "ahk_class" "Shell_TrayWnd"
try WinActivate A_OGWindow
Sendinput "{Numpad4}"
}
else
Sendinput "{NumpadLeft}"
}
<+NumpadLeft::numpadleft

NumpadClear::{
if GetKeyState("NumLock", "T")
{
A_OGWindow := WinActive("A")
WinActivate "ahk_class" "Shell_TrayWnd"
try WinActivate A_OGWindow
Sendinput "{Numpad5}"
}
else
Sendinput "{NumpadClear}"
}
<+NumpadClear::numpadclear

NumpadRight::{
if GetKeyState("NumLock", "T")
{
A_OGWindow := WinActive("A")
WinActivate "ahk_class" "Shell_TrayWnd"
try WinActivate A_OGWindow
Sendinput "{Numpad6}"
}
else
Sendinput "{NumpadRight}"
}
<+NumpadRight::numpadright

NumpadHome::{
if GetKeyState("NumLock", "T")
{
A_OGWindow := WinActive("A")
WinActivate "ahk_class" "Shell_TrayWnd"
try WinActivate A_OGWindow
Sendinput "{Numpad7}"
}
else
Sendinput "{NumpadHome}"
}
<+NumpadHome::numpadhome

NumpadUp::{
if GetKeyState("NumLock", "T")
{
A_OGWindow := WinActive("A")
WinActivate "ahk_class" "Shell_TrayWnd"
try WinActivate A_OGWindow
Sendinput "{Numpad8}"
}
else
Sendinput "{NumpadUp}"
}
<+NumpadUp::numpadup

NumpadPgUp::{
if GetKeyState("NumLock", "T")
{
A_OGWindow := WinActive("A")
WinActivate "ahk_class" "Shell_TrayWnd"
try WinActivate A_OGWindow
Sendinput "{Numpad9}"
}
else
Sendinput "{NumpadPgUp}"
}
<+NumpadPgUp::numpadpgdn

Return to “Scripts and Functions (v2)”