Jump to content

Help with hotkey plz


Recommended Posts

Sry for my newb question but i very need this

Can i made some ini file or something else to change hotkey? I need it cose i have a lil script where i set hotkey to Backspace. But other people may be want set hotkey to other key without editing script. Can it be done?

Link to comment
Share on other sites

  • Moderators

Have you tried to do it yet?

$HKValue = IniRead('Path to ini', 'Section', 'key', 'Not Found')
HotKeySet('"' & $HKValue & '"', 'FunctionToCall')

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.

Link to comment
Share on other sites

here what i try

$HKValue = IniRead('C:\Temp\myfile.ini', 'Section1', 'key', 'Hotkey')
HotKeySet('"' & $HKValue & '"', 'go')


While 1 
sleep ("10") 
WEnd 

Func go() 

Sleep(100) 
Send("{F8}") 
MouseClick("right") 
Sleep(1250) 
MouseMove(369,237, 3)
MouseClick("left") 
Sleep(200) 
Send("p") 
Sleep(50) 
MouseMove(108,144, 0) 
MouseClick("left") 

EndFunc

and this ini file

Section1
Key=F10

but it didnt do anything when i push F10. I do something wrong here?

Link to comment
Share on other sites

  • Moderators

Your ini should look like:

[section]

Key={F10}

Your section has to have brackets, and curly brackets for the F10 hotkey command.

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.

Link to comment
Share on other sites

Hmm i change this but it does not want to work :o

$HKValue = IniRead('C:\Temp\myfile.ini', 'Section', 'key', 'Not Found')
HotKeySet('"' & $HKValue & '"', 'go')


While 1 
sleep ("10") 
WEnd 

Func go() 

Sleep(100) 
Send("{F8}") 
MouseClick("right") 
Sleep(1250) 
MouseMove(369,237, 3)
MouseClick("left") 
Sleep(200) 
Send("p") 
Sleep(50) 
MouseMove(108,144, 0) 
MouseClick("left") 

EndFunc

I make ini file this path C:\Temp\myfile.ini

here it is

[section]Key={F10}

btw big thanks for help
Link to comment
Share on other sites

  • Moderators

Just out of curiousity... is your actual ini file in C:\Temp?

$HKValue = IniRead('C:\Temp\myfile.ini', 'Section', 'key', 'Not Found')
If Not $HKValue <> 'Not Found' Then MsgBox(0, 'Error', 'IniFile is not where you say it is')
HotKeySet('"' & $HKValue & '"', 'go')


While 1
    Sleep(10)
WEnd

Func go()
    Sleep(100)
    Send("{F8}")
    MouseClick("right")
    Sleep(1250)
    MouseClick("left", 369, 237, 1, 3)
    Sleep(200)
    Send("p")
    Sleep(50)
    MouseClick("left", 108, 144, 1, 1)
EndFunc
Run this code... Edited by SmOke_N

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.

Link to comment
Share on other sites

  • 1 year later...

Just out of curiousity... is your actual ini file in C:\Temp?

$HKValue = IniRead('C:\Temp\myfile.ini', 'Section', 'key', 'Not Found')
If Not $HKValue <> 'Not Found' Then MsgBox(0, 'Error', 'IniFile is not where you say it is')
HotKeySet('"' & $HKValue & '"', 'go')
While 1
    Sleep(10)
WEnd

Func go()
    Sleep(100)
    Send("{F8}")
    MouseClick("right")
    Sleep(1250)
    MouseClick("left", 369, 237, 1, 3)
    Sleep(200)
    Send("p")
    Sleep(50)
    MouseClick("left", 108, 144, 1, 1)
EndFunc
Run this code...
SmOke_N,

Do you have some time to look at this to see if there is something that sticks out at you now as being wrong? I am unable to get it to work, but I like your concept.

Thanks.

taurus905

"Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs

Link to comment
Share on other sites

SmOke_N,

Do you have some time to look at this to see if there is something that sticks out at you now as being wrong? I am unable to get it to work, but I like your concept.

Thanks.

taurus905

You're either being funny or you forgot to post/upload what you wanted SmOke_N to look at. Then again there's the forum bug could have messed up your message :)
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...