Skip to content

IsKeypad function logic is incorrect #1708

@Rainyan

Description

@Rainyan

Currently, the IsKeypad function in inputsystem is implemented as:

inline bool IsKeypad( ButtonCode_t code )
{
return ( code >= MOUSE_FIRST ) && ( code <= KEY_PAD_DECIMAL );
}

This code doesn't work, because the MOUSE_FIRST enum value checked for the lower bound is larger than the KEY_PAD_DECIMAL value that is checked for the upper bound. Therefore, this function currently returns false for all inputs.

This is probably a typo, and the lower bound should be checked against KEY_PAD_0 instead of MOUSE_FIRST:

return ( code >= KEY_PAD_0 ) && ( code <= KEY_PAD_DECIMAL );

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions