PDA

View Full Version : Detect any button pressed by player



Viking
19th March 2019, 16:30
Hey guys,

is it possible to add a function to libcod which allows the server to detect any player "button press" input?
There already are some functions like useButtonPressed(), but i want to extend the functionality to detect regular buttons ("A", "b", "5"...) as well.

Cheers

Viking

voron00
19th March 2019, 16:45
No, every possible button events are already in libcod, and you can also hook F1 and F2 keys via playercommand. But there is some old menu trick, see https://killtube.org/showthread.php?2293-Binding-custom-keys-to-perform-action&p=12535&viewfull=1#post12535 but dont expect this to work too well because of higher latency compared to native button pressed events.

Viking
19th March 2019, 17:01
The menu trick is the way i am doing it right now, but it's like you say.
The latency is a pain...

Thanks for your fast answer anyways :)

IzNoGoD
20th March 2019, 16:49
Menu too slow? Try turning the floodprotect cvar off and hijacking the menuresponses directly in the playercommand callback.