| View previous topic :: View next topic |
| Author |
Message |
WALLED !BEWARE! Deletes post on answer
Reputation: 0
Joined: 17 Feb 2020 Posts: 16
|
Posted: Mon Oct 12, 2020 6:11 am Post subject: Change text on F1 Press |
|
|
Hello,
I want to do like if you press F1 on your keyboard, the specified text will be changed to "Succeed" from "Waiting..."
So for example, i open my Trainer, i click on F1 and it will write "Succeed" text.
Any ideas how i can do that?
I did that, but it's not working (112 means F1)
| Code: | if doKeyPress(112) then
UDF1.CELabel1.Caption = "Succeed"
end |
|
|
| Back to top |
|
 |
Csimbi I post too much
Reputation: 97
Joined: 14 Jul 2007 Posts: 3327
|
Posted: Mon Oct 12, 2020 8:35 am Post subject: Re: Change text on F1 Press |
|
|
| WALLED wrote: | Hello,
I want to do like if you press F1 on your keyboard, the specified text will be changed to "Succeed" from "Waiting..."
So for example, i open my Trainer, i click on F1 and it will write "Succeed" text.
Any ideas how i can do that?
I did that, but it's not working (112 means F1)
| Code: | if doKeyPress(112) then
UDF1.CELabel1.Caption = "Succeed"
end |
|
Add your code to the OnClick event of the button.
|
|
| Back to top |
|
 |
WALLED !BEWARE! Deletes post on answer
Reputation: 0
Joined: 17 Feb 2020 Posts: 16
|
Posted: Mon Oct 12, 2020 8:42 am Post subject: Re: Change text on F1 Press |
|
|
| Csimbi wrote: | | WALLED wrote: | Hello,
I want to do like if you press F1 on your keyboard, the specified text will be changed to "Succeed" from "Waiting..."
So for example, i open my Trainer, i click on F1 and it will write "Succeed" text.
Any ideas how i can do that?
I did that, but it's not working (112 means F1)
| Code: | if doKeyPress(112) then
UDF1.CELabel1.Caption = "Succeed"
end |
|
Add your code to the OnClick event of the button. |
I already did that, but it's not working
|
|
| Back to top |
|
 |
Csimbi I post too much
Reputation: 97
Joined: 14 Jul 2007 Posts: 3327
|
Posted: Mon Oct 12, 2020 8:45 am Post subject: |
|
|
| Does the rest of the OnClick code run on tapping F1?
|
|
| Back to top |
|
 |
WALLED !BEWARE! Deletes post on answer
Reputation: 0
Joined: 17 Feb 2020 Posts: 16
|
Posted: Mon Oct 12, 2020 8:46 am Post subject: |
|
|
| Csimbi wrote: | | Does the rest of the OnClick code run on tapping F1? |
After i tap F1, nothing happens, even the text isn't changing. But i do not get any error when i press or run the code.
|
|
| Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4706
|
Posted: Mon Oct 12, 2020 10:33 am Post subject: |
|
|
You might be looking for isKeyPressed instead of doKeyPress. If so, createHotkey is probably better.
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
| Back to top |
|
 |
MMM-304 Expert Cheater
Reputation: 0
Joined: 17 Aug 2020 Posts: 170 Location: Milkey Way
|
Posted: Mon Oct 12, 2020 12:06 pm Post subject: |
|
|
| ParkourPenguin wrote: | | You might be looking for isKeyPressed instead of doKeyPress. If so, createHotkey is probably better. |
this and you need to checking for the keyPress state continuously, make a timer or loop or something because if statement executes only once (unless its in a loop or something)
|
|
| Back to top |
|
 |
|