AutoHotkey Community

It is currently May 27th, 2012, 12:15 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: June 6th, 2011, 12:44 pm 
Offline

Joined: November 28th, 2010, 5:38 am
Posts: 50
Location: Germany
Why do hotkeys such as
Code:
!Right:: Sleep 10

always use the keyboard hook?

I use AutoHotkey_L v1.0.96.00 and Windows 7 64bit.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 6th, 2011, 6:12 pm 
Offline
User avatar

Joined: February 17th, 2011, 6:48 pm
Posts: 427
Location: peering out from behind my favorite rock
My guess is that sleep requires and/or uses the keyboard hook, but I don't know. :|


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 6th, 2011, 6:38 pm 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
As far as I know, any hotKey that cannot be created with RegisterHotkey needs Keyboard hook.

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 9th, 2011, 1:21 am 
Offline

Joined: November 28th, 2010, 5:38 am
Posts: 50
Location: Germany
So, hotkeys involving Up, Down, Right, Left, PgUp, PgDown etc. cannot be created with RegisteredHotkey?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 9th, 2011, 6:36 am 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
As far as I understand this is due to IsDualStateNumpadKey keys, so any key that exist additionally on Numpad uses k-hook. So even Up::MsgBox will use k-hook.

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 9th, 2011, 7:21 am 
Offline

Joined: April 8th, 2009, 7:49 pm
Posts: 6074
Location: San Diego, California
But why does F12 need the k-hook?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 9th, 2011, 8:55 pm 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
See here ;)

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 9th, 2011, 10:49 pm 
Offline

Joined: April 8th, 2009, 7:49 pm
Posts: 6074
Location: San Diego, California
Thanks HotKeyIt.

I was in another thread some months ago and we "discovered" that hotkey F12 "triggered" the use of k-hook.
But nobody had an answer why.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: June 10th, 2011, 4:18 pm 
Offline
User avatar

Joined: February 17th, 2011, 6:48 pm
Posts: 427
Location: peering out from behind my favorite rock
HjP wrote:
Why do hotkeys such as
Code:
!Right:: Sleep 10

always use the keyboard hook?

I'm just curious :) ... why do you care?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 10th, 2011, 4:42 pm 
Offline

Joined: May 3rd, 2009, 7:16 pm
Posts: 345
Location: OH, USA
Leef_me wrote:
I was in another thread some months ago and we "discovered" that hotkey F12 "triggered" the use of k-hook.
But nobody had an answer why.

MSDN wrote:
The F12 key is reserved for use by the debugger at all times, so it should not be registered as a hot key. Even when you are not debugging an application, F12 is reserved in case a kernel-mode debugger or a just-in-time debugger is resident.

Source: RegisterHotKey


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 11th, 2011, 1:33 am 
Offline

Joined: November 28th, 2010, 5:38 am
Posts: 50
Location: Germany
LazyMan wrote:
HjP wrote:
Why do hotkeys such as
Code:
!Right:: Sleep 10

always use the keyboard hook?

I'm just curious :) ... why do you care?

I use a mouse which has some extra buttons. I use one of them for "go forward", which usually is Alt+Right. However one of my programs doesn't obey the Alt+Right convention. So I implemented a contextual Alt+Right hotkey for this program, which should be triggered by the Alt+Right sent by the mouse button. However it didn't work, since Alt+Right uses the keyboard hook and thus cannot be triggered by the send command. (This is one of the rare cases where the keyboard hook is a disadvantage.)
Meanwhile, I worked around by using an intermediary "helper hotkey".


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google Feedfetcher, Yahoo [Bot] and 15 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group