Time based input for keyboards? Need help
3 posts
• Page 1 of 1
Time based input for keyboards? Need help
I'm using this to register key presses:
I would like to change this so it only registers for the first 40ms. This is how I've accomplished it for regular button presses:
How do I apply the same thing to key presses? I take it I can't use the time_active() function for key presses?
- Code: Select all
if(key_status(ASSIGNED_STIM_TOGGLE)) {
if(stim_toggle_key_ready) {
// my code here
}
} else {
stim_toggle_key_ready = 1;
}
I would like to change this so it only registers for the first 40ms. This is how I've accomplished it for regular button presses:
- Code: Select all
if(time_active(STIM) > 40
How do I apply the same thing to key presses? I take it I can't use the time_active() function for key presses?
Setup: XIM Apex, T2, K780 keyboard, G Pro Wireless mouse, SteelSeries 4HD pad, DXRacer armrest, LucidSound LS30 headset, Netduma router, Ubiquiti UniFi AP LR
My R6 script: https://youtu.be/x-9NtxyySVM
My R6 script: https://youtu.be/x-9NtxyySVM
-
pablosscripts - Brigadier General
- Posts: 1976
- Joined: Tue Nov 24, 2015 6:27 am
Re: Time based input for keyboards? Need help
You should take a look at Scachi's xkeys.gph he published it in the GPC library,
https://www.consoletuner.com/greslib/?w500
Once included you should be able to use the function xkeys_time_active().
hmmm.... Don't you mean
https://www.consoletuner.com/greslib/?w500
Once included you should be able to use the function xkeys_time_active().
pablosscripts wrote:I would like to change this so it only registers for the first 40ms. This is how I've accomplished it for regular button presses:
- Code: Select all
if(time_active(STIM) > 40
hmmm.... Don't you mean
- Code: Select all
if(time_active(STIM) < 40
-
Sillyasskid - Captain
- Posts: 574
- Joined: Sat May 14, 2016 3:07 am
Re: Time based input for keyboards? Need help
Sillyasskid wrote:hmmm.... Don't you mean?
- Code: Select all
if(time_active(STIM) < 40
Thanks and...yes you're right
Setup: XIM Apex, T2, K780 keyboard, G Pro Wireless mouse, SteelSeries 4HD pad, DXRacer armrest, LucidSound LS30 headset, Netduma router, Ubiquiti UniFi AP LR
My R6 script: https://youtu.be/x-9NtxyySVM
My R6 script: https://youtu.be/x-9NtxyySVM
-
pablosscripts - Brigadier General
- Posts: 1976
- Joined: Tue Nov 24, 2015 6:27 am
3 posts
• Page 1 of 1
Return to GPC2 Script Programming
Who is online
Users browsing this forum: No registered users and 68 guests