HID Examples
4 posts
• Page 1 of 1
HID Examples
Hello,
Long time lurker here! Im familiar with making all my own controller scripts but now I'm particularly interested in using my Titan 2 just for keyboard and mouse. I've looked at the few examples here and still a bit confused. im just looking to get a new little snippet section for usb hid. Does anyone have an example of just a bunny hop toggle or a burst fire toggle combo.
Long time lurker here! Im familiar with making all my own controller scripts but now I'm particularly interested in using my Titan 2 just for keyboard and mouse. I've looked at the few examples here and still a bit confused. im just looking to get a new little snippet section for usb hid. Does anyone have an example of just a bunny hop toggle or a burst fire toggle combo.
-
Exx - Private First Class
- Posts: 3
- Joined: Thu Apr 25, 2019 9:11 am
Re: HID Examples
I've got this figured out had to do some forum diving but found what i was looking for.
Next what I'm looking for is just to incorporate key time held with a key status. Lets just say for Turboloot. How do I set the time with HID.
elapsed_time?
output_time?
I want to hold the e button for 500 milli before i spam my e key.
Thanks in advance
Next what I'm looking for is just to incorporate key time held with a key status. Lets just say for Turboloot. How do I set the time with HID.
elapsed_time?
output_time?
I want to hold the e button for 500 milli before i spam my e key.
Thanks in advance
-
Exx - Private First Class
- Posts: 3
- Joined: Thu Apr 25, 2019 9:11 am
Re: HID Examples
Yes with elapsed_time.
Example:
Example:
- Code: Select all
#include <keyboard.gph>
uint32 e_timer;
main {
if(key_status(KEY_E)) {
if(elapsed_time() && ++e_timer >= 500) {
combo_run(spam_e);
}
}
else e_timer = 0;
}
combo spam_e {
key_set(KEY_E, 1);
wait(20);
key_set(KEY_E, 0);
wait(20);
}
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord (2K / FPS)
- Mad
- Major General
- Posts: 4533
- Joined: Wed May 22, 2019 5:39 am
4 posts
• Page 1 of 1
Return to GPC2 Script Programming
Who is online
Users browsing this forum: No registered users and 86 guests