Jump to content

Help With Multi Hotkeying


coolness
 Share

Recommended Posts

Here is the script that I do have. it will allow me to choose one hotkey to auto write one message. but when I try to duplicate that sectoin of code, and change [f1} to {F2} in the secound string, it says its a duplicate funtion. please help, if you can.

run("notepad.exe")

HotKeySet( "{F1}", "_Open")

While 1

Wend

Func _Open ()

send("Yes f1 wrote this.")

EndFunc ;==>_Open

that script works just fine.

this one doesn't work.

run("notepad.exe")

HotKeySet( "{F1}", "_Open")

While 1

Wend

Func _Open ()

send("Yes f1 wrote this.")

EndFunc ;==>_Open

HotKeySet( "{F2}", "_Open")

While 1

Wend

Func _Open ()

send("Yes f2 wrote this.")

EndFunc ;==>_Open

Could someone please tell me what I'm doing wrong?

Link to comment
Share on other sites

do you know how, I can get it to work, to where it will allow multiple hotkey functions, under one. script?

Write. a full. sentence, using, proper grammar?

Tell the second hotkey to go to a different function. Like IceKirby said, it doesn't have anything to do with you calling it twice or using different hotkeys to call it, the reason it isn't working is because you have two declarations of Func _Open(). Call one _Open2() and you'll be fine.

Next time post support questions in the support forum. This is the Scripts and Scraps forum, a place for posting complete programs.

Link to comment
Share on other sites

Write. a full. sentence, using, proper grammar?

Easy for a person living the language!

Please reply in a neutral language, Esperanto. (hmm, not that I speak it :) )

Link to comment
Share on other sites

Comon guys hes a nooby. its not his fault he was just born that way. lol

it should look like this:

Opt("SendKeyDelay", 0);speed
run("notepad.exe")
HotKeySet( "{F1}", "_Open")
HotKeySet( "{F2}", "_Open2")
While 1
Wend

Func _Open ()
send("Yes f1 wrote this." )
EndFunc;==>_Open
Func _Open2 ()

send("Yes f2 wrote this.")
EndFunc;==>_Open2

That's it

Edited by zerocool60544

[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

Link to comment
Share on other sites

use {ctrl}{f1} or ^{f1}

READ YOUR HELP FILE

[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

Link to comment
Share on other sites

This is a very bad way to write a program.

A basic skeletton would be :

HotKeySet("{F1}", "_yourfunc")
HotKeySet("{F2}", "_yourfunc")
HotKeySet("{F2}", "_yourfunc")
....

While 1
WEnd

Func _yourfunc()
Switch @HotKeyPressed
  Case "{F1}"
    Send("F1 pressed")
  Case "{F2}"
    Send("F2 pressed")
  Case "{F3}"
    Send("F3 pressed")
EndSwitch
EndFunc

I wrote it just here, not tested, but it should work with few debug.

Apzo

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...