Skip to content

Unexpected Behavior of Regular Buttons #1241

@Noseey

Description

@Noseey

Background

Definitions:
Regular Button: Press and get only one action on either key-down or key-release. No hold functionality. (e. g. open Menu, toggle run)
Hold Button: Press and hold for continuous action. (e. g. firing a weapon, moving)
Longpress Button: Press to get one action - delay - and then continues action. (e. g. Text Input)

Version of Crispy Doom: 7.0.0

Operating System and version: Windows 10

Game: Doom, Heretic, Hexen, Strife(?)

Any loaded WADs and mods (please include full command line): -

### Bug description

Observed behavior:

Many Regular Buttons show unexpected behavior:

  • Keyboard Buttons: Holding down the button >1s re-triggers the action in rapid frequence. Try "Automap" button to reproduce.
  • Mouse Buttons: Holding down the mouse-button while moving the mouse re-triggers the action based upon mouse-movement. Try "Quick Reverse" button to reproduce.

I assume the observation might differ between Operating Systems (or even Hardware), depending on how the Raw Input is generated.

In the code, this relates to if - after performing the action - the button input is invalidated by writing directly in the Input Buffer, without applying further logic to avoid unwanted Input Updates until the physical button release, e. g. interrupts by long-press or mouse-movement.

I could see this behavior with Regular Buttons in both Vanilla Doom and Crispy Doom. Here a list of examples:

  • Toggle Detail (Vanilla, Crispy)

  • Toggle Messages (Vanilla, Crispy)

  • Toggle Automap (Vanilla, Crispy)

  • Toggle Grid, Add Marker (Vanilla, Crispy)

  • Toggle always Run (Crispy)

  • Toggle vert. mouse (Crispy)

  • Quick Reverse (Crispy)
    ...

Recommendation:
Since the behavior is also present in Vanilla for many of those Regular Buttons, I think it doesn't make sense to completely fix the issue for all of them. Triggering a key long-press requires pressing down the button for about 1s, which practically does not happen alot and makes the issue a low priority for the most part. Also, most of the regular buttons can not be bound to the mouse in Crispy.

I would only bring in additional logic to avoid this behavior for affected Regular Buttons that can be bound to the mouse and/or have impact on player actions directly. The ID guys did that e. g. for the use-cmd evaluation in p_user.c:
grafik

This means, I would recommend to add it for:

  • Quick Reverse (player impact, can be bound to mouse)
  • Toggle Follow (can be bound to mouse)

Proposed fix:
master...Noseey:crispy-doom:Btn_Robustness

Let me know your thoughts and if you managed to replicate it, thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions