Sign in to follow this  
Followers 0
Xink

HotKeySet question

4 posts in this topic

#1 ·  Posted (edited)

Hi,

I use HotKeySet with the ENTER button to do an action in my script.

But when this script is not active, i still want to use the ENTER key in windows.

It looks like the enter key is reserved for this script only and i cannot use ENTER key anymore when this script is still running.

regards,

Xink

Edited by Xink

Share this post


Link to post
Share on other sites



This is correct, when a key is bound to a function with hotkeyset, it loses it previous function. A good work around for this would be to use _IsPressed().

Share this post


Link to post
Share on other sites

This is correct, when a key is bound to a function with hotkeyset, it loses it previous function. A good work around for this would be to use _IsPressed().

Another way would be to add these 2 lines at the start of your script

Global $hkSet = false;

AdlibEnabled("sethotkey",500);

Remove the HotKetSet you have at the moment

and then add this function

Func sethotKey()
if WinActive("My App Title") and $hkSet = false then
  Hotkeyset("{ENTER}","functionname")
  $hkSet = true
endif

if (not WinActive("My App Title")) and $hkSet = true then
 HotKeySet("{ENTER}")
 $hkSet = false
endif


endfunc

This way, whenever you program becomes active it will use the Enter key, and release it when another program is being used.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Thanks for the help both :)

Xink

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0