[DIY] KEYCONF : Repeating Keystroke

Moderator: GZDoom Developers

KEYCONF : Repeating Keystroke

Postby SPZ1 » Fri Apr 23, 2021 12:53 pm

I have a bank script in a map and it is really slow having to press a key 100 times to give or take $100 so I'm asking that a new keyword be made so that a key will repeat quickly after being pressed for a second or two.
User avatar
SPZ1
 
Joined: 02 Aug 2017
Location: Illinois

Re: KEYCONF : Repeating Keystroke

Postby phantombeta » Sat Apr 24, 2021 10:56 am

You can easily do this yourself with a keybind that triggers on both key press and release.
Code: Select allExpand view
alias +MyKey "netevent \"MyKey:Pressed\""
alias -MyKey "netevent \"MyKey:Released\""

// Make the keybind for "+MyKey"

Then you handle the repeating from your own code by setting a bool and starting a counter once the key is pressed - then you just execute the action every time a certain amount of time has passed according to the timer.
User avatar
phantombeta
Tired of being treated like trash by control freaks
 
Joined: 02 May 2013

Re: KEYCONF : Repeating Keystroke

Postby SPZ1 » Sun Apr 25, 2021 9:47 am

I think I understand what you mean but I can't make any sense of this code you posted
User avatar
SPZ1
 
Joined: 02 Aug 2017
Location: Illinois

Re: KEYCONF : Repeating Keystroke

Postby Matt » Tue Apr 27, 2021 4:15 pm

Sounds like the best solution is to edit the script so you've got an option for taking out $1 per press, or a larger amount per press, or hold to take out $1 each tic that the engine notices that the button is being pressed.
User avatar
Matt
Putting the XD into *xdeath since 2007
 
Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: KEYCONF : Repeating Keystroke

Postby SPZ1 » Thu Apr 29, 2021 4:32 pm

I have the solution to this problem! Check this thread:

https://forum.zdoom.org/viewtopic.php?f=122&t=72110
User avatar
SPZ1
 
Joined: 02 Aug 2017
Location: Illinois


Return to Closed Feature Suggestions

Who is online

Users browsing this forum: No registered users and 0 guests