Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Enter key and Return key problem


  • Please log in to reply
9 replies to this topic
feldruebe
  • Members
  • 5 posts
  • Last active: Jul 28 2010 02:07 PM
  • Joined: 22 Jul 2010
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?

TheAllmighty
  • Guests
  • Last active:
  • Joined: --
NumpadEnter::Enter[quote]?[/quote]


TheAllmighty
  • Guests
  • Last active:
  • Joined: --
i meant:
NumpadEnter::Enter
?

feldruebe
  • Members
  • 5 posts
  • Last active: Jul 28 2010 02:07 PM
  • Joined: 22 Jul 2010
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:
!NumpadEnter::MsgBox asdf
this 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

SoLong&Thx4AllTheFish
  • Members
  • 4999 posts
  • Last active:
  • Joined: 27 May 2007
Perhaps:

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



feldruebe
  • Members
  • 5 posts
  • Last active: Jul 28 2010 02:07 PM
  • Joined: 22 Jul 2010
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
a::
GetKeyState NumpadEnterKeyState, Return
MsgBox %NumpadEnterKeyState%
Send {Return}
return

NumpadEnter::
GetKeyState NumpadEnterKeyState, Return
MsgBox %NumpadEnterKeyState%
Send {Return}
return


  • Guests
  • Last active:
  • Joined: --
push

None
  • Members
  • 3199 posts
  • Last active: Nov 05 2015 09:55 PM
  • Joined: 28 Nov 2009
NumpadEnter::

GetKeyState NumpadEnterKeyState, NumpadEnter ;you sure you don't want numpad enter here?

MsgBox %NumpadEnterKeyState%

Send {Return}

return


  • Guests
  • Last active:
  • Joined: --
If nothing else can't you just remap the NumPad keys with NumLock off using AHK?

feldruebe
  • Members
  • 5 posts
  • Last active: Jul 28 2010 02:07 PM
  • Joined: 22 Jul 2010

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