Sign in to follow this  
Followers 0
iverson_est

One Tiny Question

8 posts in this topic

Can a variable set as hotkey. For example i want it to read the hotkey from ini file. I tried it like

Hotkeyset("$exit", "terminate")

$exit= iniread(the blah blah here)

func terminate ()

exit 0

It didn't work :) Is there any speacial way?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

If the hotkey is like {enter} or {pause} this should work

HotKeySet("'" & $exit & "'", "terminate")
Also notice the nifty code tags :) Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

but it won't work with other keys? like a or e or j or something?

Share this post


Link to post
Share on other sites

Try this example

$exit = 'j'
HotKeySet($exit, 'terminate')

While 1
    Sleep(1000)
WEnd

Func terminate()
    MsgBox(0x40040, @ScriptName, 'Hotkey used: ' & $exit)
    Exit
EndFunc

:)

Share this post


Link to post
Share on other sites

well y but can it be read from ini?

Share this post


Link to post
Share on other sites

well y but can it be read from ini?

$exit = iniread()

then use the script MHz gave you

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Can a variable set as hotkey. For example i want it to read the hotkey from ini file. I tried it like

Hotkeyset("$exit", "terminate")

$exit= iniread(the blah blah here)

func terminate ()

exit 0

It didn't work :) Is there any speacial way?

at the point you're setting the hotkey, $exit is still undeclared....

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

´if u set HotKeySet($exit etc etc) the it will exit when u type manually $exit :/ any special ways?

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