| View previous topic :: View next topic |
| Author |
Message |
ictium
Joined: 12 Nov 2009 Posts: 8
|
Posted: Sun Nov 22, 2009 3:23 pm Post subject: Reuse as normal keystroke a key also used as hotkey |
|
|
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! |
|
| Back to top |
|
 |
i3egohan
Joined: 18 Jul 2006 Posts: 401
|
Posted: Sun Nov 22, 2009 5:27 pm Post subject: |
|
|
| Seriously... How can we help if you havent even posted your code. Theres obviously bugs |
|
| Back to top |
|
 |
txquestor
Joined: 22 Aug 2009 Posts: 294
|
Posted: Sun Nov 22, 2009 8:20 pm Post subject: |
|
|
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 :: _________________
"Man's quest for knowledge is an expanding series whose limit is infinity" |
|
| Back to top |
|
 |
ictium
Joined: 12 Nov 2009 Posts: 8
|
Posted: Wed Nov 25, 2009 6:47 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
|