Jump to content

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

stuck ctrl key?


  • Please log in to reply
24 replies to this topic
bblum
  • Members
  • 3 posts
  • Last active: May 08 2005 11:59 PM
  • Joined: 03 May 2005
I'm running v. 1.0.30.4 on a IBM Thinkpad R51 xp sp2. I use it to remap my Ralt to Rwin, my rCtrl to del, and the 'forward' and 'back' keys to home and end. It really makes me much happier w/ my keyboard, but I am having an intermittent problem that is quite annoying. Periodically, the system acts as if a ctrl key were stuck down. If I shut down autohotkey and my other applications, somtimes after a few minutes, it recovers, but it's very inconvenient. As far as I can tell, it only happens w/ autohotkey running. I'm going to install the latest version today, but I've had this problem with one earlier version also, and I didn't see anything in the changelog addressing this. Any suggestions/workarounds?

Bruce

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
If you could post the section of your script that remaps the keys in question, that would help. Also, if you know a series of keystrokes or window activations that a user could do manually to reproduce the problem, that would be ideal.

In the meantime, one thing that might help when the keys get stuck is to press and release the Control key, which should reset it without even needing to restart the script.

bblum
  • Members
  • 3 posts
  • Last active: May 08 2005 11:59 PM
  • Joined: 03 May 2005
Thanks for the reply.

Here's my script:

#singleinstance
#installkeybdhook
#notrayicon
#usehook

!Browser_back::send, !{home}
!Browser_forward::send, !{end}

^+Browser_back::send, ^+{home}
^+Browser_forward::send, ^+{end}

+Browser_back::send, +{home}
+Browser_forward::send, +{end}

^Browser_back::send, ^{home}
^Browser_forward::send, ^{end}

Shift & rctrl::send, +{Del}

Browser_back::send, {home}
Browser_forward::send, {end}

rctrl::send, {del}
^!rctrl::send, ^!{del}

*RAlt:: ; The asterisk makes the remapping more complete on XP/2k/NT.
Send, {rwin down}
keywait, ralt
Send, {rwin up}
return


Unfortunately, I have not found any set of keystrokes that seem to 'produce' the problem, and pushing ctrl does not reset it. I've even used windows accessibility to look and see if any keys are 'down' and it does not show them as 'down.' Is there anything else that I should look for in the logs that might help?

Bruce

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
When the key sticks, do you mean that: 1) unwanted CTRL hotkeys fire; or 2) the active window behaves as though the control key is down?

If it's the second one, I've seen that happen sometimes when the active window is deactivated while the CTRL key is down. Later, when you return to that one particular window, it might still think the CTRL key is down because it wasn't watching when you released it.

If the entire system thinks the CTRL key is stuck down, you might try using the following hotkey whenever it happens. Near the top of its window, it will show you what modifier keys are logically vs. physically down:

*ScrollLock::KeyHistory ; Press ScrollLock to display the key history window.

Finally, there's a way to remap keys a lower level using the registry. Although this change is semi-permanent -- meaning that a reboot is required to undo it -- it is a very pure way of remapping that should avoid any possibility of sticking keys.

bblum
  • Members
  • 3 posts
  • Last active: May 08 2005 11:59 PM
  • Joined: 03 May 2005
When the key sticks I mean 3) the entire system behaves as though the ctrl key is down, every window, the desktop, you name it!

Thanks for the tips. I don't mind the hotkeys being semi-permanent--unless they stick--because I use them all the time.

I'll post later if I find out what's going on more specifically. Since I updated to the latest version, I've not had trouble, but sometimes it goes for days between snags, so I'm not sure the update has changed anything.

Sure appreciate this program!

Bruce

Imago
  • Guests
  • Last active:
  • Joined: --
I use a laptop (Dell 5150) with your software and am also experienceing stuck Control, Shift and most noticabley (because of the rapidly flashing indicator light) Caps Lock keys.

FAN BOOST.ahk
Loop 
{
	ControlSend, Button8,{SPACE},Dell Inspiron 8000/8100/8200 fan control V2.2.0 - (c) 2004 by C. Diefer
	Sleep 15
}

Great program, wish it didnt make me type 1337 all the time

:twisted:

I will now turn on AutoHotKey.exe and my Caps Lock and type few bits of garbage:

IT ReAllY suCkS WhEN yOur LAPTOP Gets SO Hot IT BegiNs to SLOw DOWn.

:wink:

  • Guests
  • Last active:
  • Joined: --
use WinBatch

FAN BOOST.wbt
AddExtender("wwctl44i.dll")

sAppWndName = "Dell Inspiron 8000/8100/8200 fan control V2.2.0 - (c) 2004 by C. Diefer"
hWnd = cFindByName(sAppWndName)
ControlHandle=cWndByID(hWnd,1000)

While (1==1)
cClickButton(ControlHandle)
TimeDelay(5)
EndWhile

:twisted: :roll: :twisted:

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
There are a couple of things that might help with ControlSend:

SetStoreCapslockMode: Disables the changing of the Capslock key.

The alternate method of sending modifiers, which involves specifying something like {Alt down}f{AltUp} instead of !f. This special mode makes a difference only with ControlSend, not Send. The help file has more details.

  • Guests
  • Last active:
  • Joined: --
thanks for the reference.

the winbatch interpreter has a 614k footprint....im just gunna go with that

cheers

hujhax
  • Members
  • 10 posts
  • Last active: Nov 09 2011 02:45 PM
  • Joined: 26 Jan 2009
I've run into a similar issue to what people are seeing here. This is on a computer where SendInput runs rather slowly.

After some debugging, I created this test hotkey:
$+b::SendInput llllll

Now if I type shift-b, and then release the shift key before all the "l"s appear on the screen, the shift key gets stuck down.

Why? And how do I get it unstuck?

EDIT: Okay, it looks like I can fix issues like this by throwing in the appropriate "KeyWait" command -- in this case, "KeyWait, Shift".

:mrgreen:

nausher
  • Members
  • 8 posts
  • Last active: Jan 25 2014 01:29 AM
  • Joined: 23 Jul 2010
I seem to have the same problem with my script for
Shift + MouseWheel Scroll => Alt + Tab
[For window switching in Windows]

And this works 4 out of 5 times, but seems to stop working
suddenly, or when I switch directions.

Here is my current script

;>>>Scroll Tab<<<
Shift & WheelDown::AltTab
Shift & WheelUp::ShiftAltTab

I tried capturing the KeyHistory but there isn't anything that seems
wrong outright E.g. 2 Alt presses followed by Tab presses do work
without the script. Though I am not sure I understood the difference
between the type 'h' & 'i'.

VK  SC	Type	Up/Dn	Elapsed	Key		Window
-------------------------------------------------------------------
A1  136	 	d	0.03	RShift         	
A1  136	 	d	0.03	RShift         	
A1  136	 	u	0.03	RShift         	
A4  038	i	u	0.00	Alt            	
A4  038	 	d	3.48	Alt            	N/A
09  00F	 	d	0.09	Tab            	
09  00F	 	u	0.11	Tab            	
09  00F	 	d	0.42	Tab            	
09  00F	 	u	0.14	Tab            	
A4  038	 	u	0.08	Alt            	
74  03F	 	d	1.33	F5             	C:\My Scripts\MouseHotKeysAndScroll.ahk - AutoHotkey

Any help will be appreciated.

Thanks

mattyjd
  • Guests
  • Last active:
  • Joined: --
Hi All

I am having a similar issue here. It's a simple macro and it happens each time.

^!g::
sendinput {RAW}Please note that if the IR runs lower than quoted pricing and feasibility are subject to change. If the IR drops to 5`% or below we will be on best efforts. Pricing must be confirmed against final quota requirements. We requires your project team to provide us with a specific term report in order to determine final IR. Without this, final billing will reflect the final IR observed in our systems. Our minimum engagement fee is $250. Please let me know if you have any questions.
return

When I use the scroll lock dealy posted here I get:
Window: cavaets [sendinput].ahk - Notepad
Keybd hook: yes
Mouse hook: no
Enabled Timers: 0 of 0 ()
Interrupted threads: 0
Paused threads: 0 of 1 (0 layers)
Modifiers (GetKeyState() now) = LCtrl LAlt
Modifiers (Hook's Logical) = LCtrl LAlt
Modifiers (Hook's Physical) = LCtrl LAlt
Prefix key is down: no

NOTE: To disable the key history shown below, add the line "#KeyHistory 0" anywhere in the script. The same method can be used to change the size of the history buffer. For example: #KeyHistory 100 (Default is 40, Max is 500)

The oldest are listed first. VK=Virtual Key, SC=Scan Code, Elapsed=Seconds since the previous event. Types: h=Hook Hotkey, s=Suppressed (blocked), i=Ignored because it was generated by an AHK script, a=Artificial, #=Disabled via #IfWinActive/Exist.

VK SC Type Up/Dn Elapsed Key Window
-------------------------------------------------------------------------------------------------------------
48 023 i u 0.00 H
41 01E i d 0.00 A
41 01E i u 0.00 A
56 02F i d 0.00 V
56 02F i u 0.00 V
45 012 i d 0.00 E
45 012 i u 0.00 E
20 039 i d 0.00 Space
20 039 i u 0.00 Space
41 01E i d 0.00 A
41 01E i u 0.00 A
4E 031 i d 0.00 N
4E 031 i u 0.00 N
59 015 i d 0.00 Y
59 015 i u 0.00 Y
20 039 i d 0.00 Space
20 039 i u 0.00 Space
51 010 i d 0.00 Q
51 010 i u 0.00 Q
55 016 i d 0.00 U
55 016 i u 0.00 U
45 012 i d 0.00 E
45 012 i u 0.00 E
53 01F i d 0.00 S
53 01F i u 0.00 S
54 014 i d 0.00 T
54 014 i u 0.00 T
49 017 i d 0.00 I
49 017 i u 0.00 I
4F 018 i d 0.00 O
4F 018 i u 0.00 O
4E 031 i d 0.00 N
4E 031 i u 0.00 N
53 01F i d 0.00 S
53 01F i u 0.00 S
BE 034 i d 0.00 .
BE 034 i u 0.00 .
A4 038 i d 0.00 Alt
A2 01D i d 0.00 Ctrl
91 046 h d 2.74 Scroll Lock

It clearly shows that Alt + Ctrl are being pushed down at the end of the script. Perhaps this is because the command is called with ctrl and alt being pressed. This was not an issue before I reverted to 'sendinput' instead of 'send' so I suspect this is the case as sendinput is so much faster.

How can I specify a delay or assure that ctrl+alt are not pressed when I finish the macro?

Otherwise any simple way to assign a hotkey to a macro that avoids this would be appreciated!

SoLong&Thx4AllTheFish
  • Members
  • 4999 posts
  • Last active:
  • Joined: 27 May 2007
Don't send such longs texts, paste it
Text=Please note that if the IR runs lower than quoted pricing and feasibility are subject to change. If the IR drops to 5`% or below we will be on best efforts. Pricing must be confirmed against final quota requirements. We requires your project team to provide us with a specific term report in order to determine final IR. Without this, final billing will reflect the final IR observed in our systems. Our minimum engagement fee is $250. Please let me know if you have any questions.

^!g::
clipboard:=Text
Send ^v
return
Look at clipboard page for example on how to save/restore the clipboard if you want to retain it.

mattyjd
  • Guests
  • Last active:
  • Joined: --
Thanks. This does work better.

bwarner
  • Guests
  • Last active:
  • Joined: --
Hi all,
I have a similar problem.

This script I've written changes the font of selected text in an Outlook email. It does this by opening the font dialog and changing font etc.

Once the font has been changed, both my control and win keys are stuck down. After reading these posts I suspect this is because the script launches a windows dialog.

I've tried various methods to "unstick" these keys; Keywait, sending the UP of both keys, but nothing seems to unstick them.

Any help would be appreciated.

Script is:

^#p::
	Send, !o f 
	SendInput, Courier New
	Sleep 500
	Send {TAB 5}{DOWN 5}
	Sleep 500
	Send {ENTER}
	Sleep 500
return