KEYCONF : Repeating Keystroke

Moderator: GZDoom Developers

User avatar
SPZ1
Posts: 324
Joined: Wed Aug 02, 2017 3:01 pm
Location: Illinois

KEYCONF : Repeating Keystroke

Post by SPZ1 »

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
phantombeta
Posts: 2110
Joined: Thu May 02, 2013 1:27 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: Brazil

Re: KEYCONF : Repeating Keystroke

Post by phantombeta »

You can easily do this yourself with a keybind that triggers on both key press and release.

Code: Select all

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
SPZ1
Posts: 324
Joined: Wed Aug 02, 2017 3:01 pm
Location: Illinois

Re: KEYCONF : Repeating Keystroke

Post by SPZ1 »

I think I understand what you mean but I can't make any sense of this code you posted
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

Re: KEYCONF : Repeating Keystroke

Post by Matt »

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
SPZ1
Posts: 324
Joined: Wed Aug 02, 2017 3:01 pm
Location: Illinois

Re: KEYCONF : Repeating Keystroke

Post by SPZ1 »

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

viewtopic.php?f=122&t=72110

Return to “Closed Feature Suggestions [GZDoom]”