AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The keyboard and/or mouse hook could not be activated

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Mountie



Joined: 30 Oct 2007
Posts: 20

PostPosted: Fri Nov 20, 2009 2:04 pm    Post subject: The keyboard and/or mouse hook could not be activated Reply with quote

When starting autohotkey, I get the following error message:
Warning: The keyboard and/or mouse hook could not be activated; some parts of the script will not function

I thought the problem might be with one of the memory resident programs that I have running in the background. So, I shutdown all memory resident programs, tried to start autohotkey again and still continue to get the same message. I also tried including some directives at the beginning of the script to force keyboard and mouse hooks to install, but this did not work either.

Any advice on what to do?
Back to top
View user's profile Send private message
Leef_me



Joined: 08 Apr 2009
Posts: 1158
Location: San Diego, California

PostPosted: Fri Nov 20, 2009 7:51 pm    Post subject: Reply with quote

post your script
Back to top
View user's profile Send private message
Mountie



Joined: 30 Oct 2007
Posts: 20

PostPosted: Fri Nov 20, 2009 8:06 pm    Post subject: Reply with quote

The problem isn't with any particular script. It is with any script that has a
hotkey. Scripts without a hotkey work fine; while those with a hotkey all of
a sudden no longer work when they did work properly previously. There
seems to be something that is preventing any script with a hotkey from
registering with the PC. I have the same scripts elsewhere without any issues.
Back to top
View user's profile Send private message
Carcophan



Joined: 24 Dec 2008
Posts: 768
Location: :noitacoL

PostPosted: Fri Nov 20, 2009 8:23 pm    Post subject: Reply with quote

Quote:
As mentioned in the help file under #UseHook, most scripts (i.e. those that use no hotkeys or just some simple keyboard hotkeys) do not need the keyboard hook, and thus it is not activated. Similarly, the mouse hook is not active unless your script uses mouse hotkeys or includes the #InstallMouseHook directive.


If you don't need them, take them out.

Quote:
Scripts without a hotkey work fine; while those with a hotkey all of
a sudden no longer work when they did work properly previously

Take out the hook as a test, does it still wonk out?



Quote:
Any advice on what to do?

Even though you may not see an error, and things DO work on other PC's, it doesn't mean that posting your code will still not help us to help you. We can 'guess' all day at what the problem is, but "A picture is worth a thousand words". If there is 'secret' stuff, take out what you can, and rename other things.

Leef_me wrote:
post your script

_________________
"Unfortunately a "COM for Dummies" book would be a little like "Neurosurgery for Dummies," in the end you're just gonna have to learn" ~Tank
Back to top
View user's profile Send private message AIM Address
Mountie



Joined: 30 Oct 2007
Posts: 20

PostPosted: Fri Nov 20, 2009 8:49 pm    Post subject: Reply with quote

Here's an example of a script that does not work.

Code:

#SingleInstance  force
#Hotstring SE K10

#NoEnv
#MaxMem 1
#KeyHistory 0
SetWinDelay 0
SetKeyDelay 100
SetTitleMatchMode 2


Menu, mnuMain, Add  ; Add a separator line.
Menu, mnuMain, Add, &A Menu item A, mhMain
Menu, mnuMain, Add  ;-----------------

#Right::Menu, mnuMain, Show     ,500,750   

return  ; End of script's auto-execute section.

mhMain:
 cmd := substr(A_ThisMenuItem,2,1)

 if cmd = A
 {
   send,123
 }
Back to top
View user's profile Send private message
Mountie



Joined: 30 Oct 2007
Posts: 20

PostPosted: Wed Dec 02, 2009 9:00 pm    Post subject: Reply with quote

Has anyone had the same problem activating scripts?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group