| View previous topic :: View next topic |
| Author |
Message |
Mountie
Joined: 30 Oct 2007 Posts: 20
|
Posted: Fri Nov 20, 2009 2:04 pm Post subject: The keyboard and/or mouse hook could not be activated |
|
|
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 |
|
 |
Leef_me
Joined: 08 Apr 2009 Posts: 1158 Location: San Diego, California
|
Posted: Fri Nov 20, 2009 7:51 pm Post subject: |
|
|
| post your script |
|
| Back to top |
|
 |
Mountie
Joined: 30 Oct 2007 Posts: 20
|
Posted: Fri Nov 20, 2009 8:06 pm Post subject: |
|
|
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 |
|
 |
Carcophan
Joined: 24 Dec 2008 Posts: 768 Location: :noitacoL
|
Posted: Fri Nov 20, 2009 8:23 pm Post subject: |
|
|
| 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 |
|
 |
Mountie
Joined: 30 Oct 2007 Posts: 20
|
Posted: Fri Nov 20, 2009 8:49 pm Post subject: |
|
|
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 |
|
 |
Mountie
Joined: 30 Oct 2007 Posts: 20
|
Posted: Wed Dec 02, 2009 9:00 pm Post subject: |
|
|
| Has anyone had the same problem activating scripts? |
|
| Back to top |
|
 |
|