Jump to content
Sign in to follow this  
swe20144

HotKeySet for pressing of control key twice

Recommended Posts

swe20144

Hi Guys

Any idea why this code doesnt work?

HotKeySet("{LCTRL}{LCTRL}", "ShowMessage") ;Control pressed twice
 

I want to run some code when the user presses the control key twice.

Thanks

Sam

Share this post


Link to post
Share on other sites
AlmarM

What about increasing a counter to check the amount of times you pressed it?


Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Share this post


Link to post
Share on other sites
swe20144

Even this doesnt work:

HotKeySet("{LCTRL}", "ShowMessage") ;Control pressed twice

Share this post


Link to post
Share on other sites
AlmarM

If you look here, you will see that CTRL cannot be bound using HotKeySet().

Try _IsPressed from Misc.au3.


Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Share this post


Link to post
Share on other sites
AdamUL

You could also have a look at the >HotStrings UDF, it may work for what you are trying to do.  As AlmarM mentioned, you can use _IsPressed as shown in the help file.  

 

Adam

Edited by AdamUL

Share this post


Link to post
Share on other sites
AlmarM

Again, _IsPressed will check if a key is pressed. I think you want this. :thumbsup:


Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

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  

×