AutoHotkey Community

It is currently May 27th, 2012, 2:41 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: November 22nd, 2009, 4:23 pm 
Offline

Joined: November 12th, 2009, 9:37 pm
Posts: 8
I All,

I create a script that triggers when I hold down spacebar and press "f" key.

I noticed that once the script finishes running I cannot use the spacebar in normal text to insert a space.

I tried to use :
Code:
#InstallKeybdHook
GetKeyState, state, space
    if state = D
        Send {Space down}
    else
        Send {Space up}


at the end of the script but it does not help.

I also used the workaround of prefixing "space & f::" with a tilde. It works good but does not prevent me from actually inserting a space when I type the hotkey.


I think the best solution would be to add a final line in the script telling AHK to consider spacebar as a normal key.

Thanks for helping!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 22nd, 2009, 6:27 pm 
Offline

Joined: July 18th, 2006, 12:18 pm
Posts: 403
Seriously... How can we help if you havent even posted your code. Theres obviously bugs


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 22nd, 2009, 9:20 pm 
Offline

Joined: August 22nd, 2009, 11:23 pm
Posts: 294
Since you didn't post you're actual code.
the way you allow normal operation of a key used in a hotkey is:
Quote:
~ (tilde)
When the hotkey fires, its key's native function will not be blocked (hidden from the system). In both of the below examples, the user's click of the mouse button will be sent to the active window:
Hotkeys


Code:
; Allow normal SPACE key
~space::
; OR
~space & f::


Add whatever you hotkey code is after the ::

_________________
Image
"Man's quest for knowledge is an expanding series whose limit is infinity"


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 25th, 2009, 7:47 am 
Offline

Joined: November 12th, 2009, 9:37 pm
Posts: 8
Thank you for your post. As I said in a previous post I used this approach

Quote:
I also used the workaround of prefixing "space & f::"


and it worked.

My feeling is that since spacebar is used as a hotkey, whatever line at the end of the code that may make it useable as a normal key will never have effect because spacebar as a hotkey will always have precedence whenever the run finishes running.

Thus the "tilde" approach is the right one.


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Alpha Bravo, Google [Bot], rbrtryn and 16 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