AHK:在Numlock处于打开状态的情况下重新映射数字小键盘,因此其行为类似于在Numlock处于关闭状态的数字小键盘 [英] AHK: remap numeric keypad with Numlock On so it behaves like numeric keypad with Numlock Off
问题描述
我想重新启用Numlock的数字小键盘,使其行为与关闭Numlock的数字小键盘一样,包括能够在按住Shift/Ctrl的同时扩展选择范围.
I'd like to remap the numeric keypad with Numlock On to behave like the numeric keypad with Numlock Off, including being able to extend the selection with Shift/Ctrl held down.
我的问题是以下
Numpad8::Up
当按下shift + numpad8时,光标没有上移,但是没有选择文本.以下内容也不符合我的期望(行为与Numpad :: 8相同).
Doesn't have correct behaviour when shift+numpad8 is pressed, the cursor moves up, but no text is selected. The following also don't work as I'd like (same behaviour as Numpad::8).
+Numpad8::Up
+Numpad8::+Up
如果我重新映射普通键,则在按下shift键时选择行为是正确的:
If I remap a normal key, the selection behaviour is correct when shift is pressed:
w::Up
有任何提示吗?
我这样做的原因是制作一个 CoolerMaster QuickFire TK 数字小键盘的行为就像它具有标准的数字小键盘布局一样(我也发生了一些注册表键盘重映射,这就是为什么我希望Numlock On处于导航状态).
The reason I'm doing this is to make a CoolerMaster QuickFire TK's numeric keypad behave like it has a standard numeric keypad layout (I've some registry keyboard remapping happening as well, which is why I want the navigation behaviour with Numlock On).
推荐答案
这是可能的,但与正常的重新映射相比,这是很痛苦的事情.
It's possible, but it's a pain in the ass... compared to normal remapping.
这是Numpad8键的正常行为:
Here is the normal behaviour of the Numpad8-key:
启用数字键盘:
num8:向上
shift + num8:标记
With numpad on:
num8: up
shift+num8: mark up
关闭数字键盘:
num8:8
shift + num8:up
With numpad off:
num8: 8
shift+num8:up
因此,如果您想扭转这种情况,我们想要的是这样:
So if you want to reverse that, what we want is this:
启用数字键盘:
num8:8
shift + num8:up
With numpad on:
num8: 8
shift+num8:up
关闭数字键盘:
num8:向上
shift + num8:标记
With numpad off:
num8: up
shift+num8: mark up
这是可以实现的方式:
*NumpadUp::
If GetKeyState("NumLock", "T")
SendInput, {Shift Down}{Up}
Else If GetKeyState("Shift")
SendInput, {Shift Up}{NumpadUp}
Else
SendInput, {Shift Up}{Numpad8}
Return
*Numpad8::
If GetKeyState("Shift")
SendInput, {Shift Down}{NumpadUp}
Else
SendInput, {NumpadUp}
Return
现在,您只需要对要反转的其他数字键盘键执行相同的操作即可.
Now you just need to do the same thing for the other numpad keys that you want to reverse.
这篇关于AHK:在Numlock处于打开状态的情况下重新映射数字小键盘,因此其行为类似于在Numlock处于关闭状态的数字小键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!