An ACS library for ZDoom-based ports
bool PlayerKeyToggledAny(int player, int key)
See Input functions.