Results 1 to 4 of 4

Thread: Detect any button pressed by player

  1. #1
    ... connecting
    Join Date
    Aug 2018
    Posts
    8
    Thanks
    0
    Thanked 1 Time in 1 Post

    Detect any button pressed by player

    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

  2. #2
    Corporal voron00's Avatar
    Join Date
    Nov 2014
    Posts
    248
    Thanks
    64
    Thanked 216 Times in 116 Posts
    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?...ll=1#post12535 but dont expect this to work too well because of higher latency compared to native button pressed events.
    sudo apt-get rekt

  3. #3
    ... connecting
    Join Date
    Aug 2018
    Posts
    8
    Thanks
    0
    Thanked 1 Time in 1 Post
    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

  4. #4
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Menu too slow? Try turning the floodprotect cvar off and hijacking the menuresponses directly in the playercommand callback.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  5. The Following User Says Thank You to IzNoGoD For This Useful Post:

    kung foo man (20th March 2019)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •