Hi,
I have an acer notebook with a notepad with included numpad
the problem is, whenever i activate num-lock, my return key does not send return interrupts but enter interrupts,
so it's like i hit the enter key and not the return key (for those who don't know, there is a difference between those keys and the program i work with handles them completely differnet (return makes a new line, enter confirms the input)).
so this is extremely annoying because i can't really use the numpad right now and i though this might be changeable with a autohotkey script.
unfortunately im a complete beginner with autohotkey, just stumbled over it a few days ago and didn't do anything with it yet, so i wanted to ask for some help.
What I want to do is:
whenever the return key is hit, i want to catch that interrupt, and send a normal return interrupt, because, for whatever reason, when the numlock key is activated, an enter-interrupt is sent instead.
does anyone of you have an idea of how to do this?
Enter key and Return key problem
Started by
feldruebe
, Jul 28 2010 08:57 AM
9 replies to this topic
#1
-
Posted 28 July 2010 - 08:57 AM
thanks for the fast reply, unfortunately this is not the solution i'm looking for.
the problem is this:
whenever numlock is activated, the return key (over the arrow keys) sends the same interrupt as the enter key (at the right side of the num pad), i don't know what is causing it, probably a driver error from windows.
i tested it by using the script:
so, for the computer those two keys are absolutely the same.
what i want to do now, is find out, which one of those keys triggered the interrupt.
i can't just remap the NumpadEnter interrupt, because i still need it when i want to use enter
currently i'm using a work around: when the ALT-key is pressed, i always remap the enter interrupt to a return interrupt. but this is not really satisfying
the problem is this:
whenever numlock is activated, the return key (over the arrow keys) sends the same interrupt as the enter key (at the right side of the num pad), i don't know what is causing it, probably a driver error from windows.
i tested it by using the script:
!NumpadEnter::MsgBox asdfthis msg box is displayed when i hit the return key with activated num lock
so, for the computer those two keys are absolutely the same.
what i want to do now, is find out, which one of those keys triggered the interrupt.
i can't just remap the NumpadEnter interrupt, because i still need it when i want to use enter
currently i'm using a work around: when the ALT-key is pressed, i always remap the enter interrupt to a return interrupt. but this is not really satisfying
#4
-
Posted 28 July 2010 - 10:00 AM
Perhaps:
and
Sets the state of the Numlock key. Can also force the key to stay on or off.
Source: http://www.autohotke...psLockState.htm
and
Checks if a keyboard key or mouse/joystick button is down or up. Also retrieves joystick status.
Source: http://www.autohotke...GetKeyState.htm
#5
-
Posted 28 July 2010 - 10:23 AM
Thanks for the ideas, i tried to use them but i stepped over a problem:
you suggested the setNumPadLock method, but i cant use this method because once the interrupt is sent i cant determine which key sent it, setting the numlock to disabled does not change this
then i tried the getStateOf method, sounded really promising but it doesn't work the way i wanted.
in the example i tried to check the state the return key when a numlockenter interrupt is recieved.
but whenever i try this the state is always read as "up"
however i tested to bind the same functionality to my a-key and when i hit the enter key, keep it pressed, then hit the a key it works.
so appearently the key state is not updated before the interrupt is processed. does anyone have an idea about how to solve this?
here is the code i used
you suggested the setNumPadLock method, but i cant use this method because once the interrupt is sent i cant determine which key sent it, setting the numlock to disabled does not change this
then i tried the getStateOf method, sounded really promising but it doesn't work the way i wanted.
in the example i tried to check the state the return key when a numlockenter interrupt is recieved.
but whenever i try this the state is always read as "up"
however i tested to bind the same functionality to my a-key and when i hit the enter key, keep it pressed, then hit the a key it works.
so appearently the key state is not updated before the interrupt is processed. does anyone have an idea about how to solve this?
here is the code i used
a:: GetKeyState NumpadEnterKeyState, Return MsgBox %NumpadEnterKeyState% Send {Return} return NumpadEnter:: GetKeyState NumpadEnterKeyState, Return MsgBox %NumpadEnterKeyState% Send {Return} return
#6
-
Posted 28 July 2010 - 01:52 PM
NumpadEnter:: GetKeyState NumpadEnterKeyState, NumpadEnter ;you sure you don't want numpad enter here? MsgBox %NumpadEnterKeyState% Send {Return} return
#8
-
Posted 30 July 2010 - 07:29 PM
If nothing else can't you just remap the NumPad keys with NumLock off using AHK?
#9
-
Posted 31 July 2010 - 06:36 AM
NumpadEnter:: GetKeyState NumpadEnterKeyState, NumpadEnter ;you sure you don't want numpad enter here? MsgBox %NumpadEnterKeyState% Send {Return} return
i'm not sure what you mean by that, are you saying the key is named "numpad enter"?
If nothing else can't you just remap the NumPad keys with NumLock off using AHK?
Well, i could remap the numpad enter key to the return key, the problem here is that my normal return key sends the same interrupt as the numpad enter key when num-lock is activated). therefore i don't know which key sent the interrupt
#10
-
Posted 09 August 2010 - 06:04 AM