Skip to content

multi-key bindings apply just_pressed retroactively #6

@PhaestusFox

Description

@PhaestusFox

at the moment pressing ctrl -> enter is the same as enter -> ctrl this wouldn't be a problem except when you have something happen on ctrl + enter and something different on just enter. what gets triggered and the order is different depending on the order things are pressed;
for example, having something bound to LCtrl + Return and Return will

  • on Return+ -> LCtrl+ -> Return- -> LCtrl- = runs Return -> LCtrl + Return
  • on LCtrl+ -> Return+ -> Return- -> LCtrl- = runs LCtrl + Return
  • on LCtrl+ -> Return+ -> LCtrl- -> Return- = runs LCtrl + Return -> Return
  • on Return+ -> LCtrl+ -> LCtrl- -> Return- = runs Return -> LCtrl + Return -> Return

this is not what it should do.

I don't know the best way to fix this but one way would be to have a "final" key that actual check all the other keys are pressed on the frame it gets set to just_pressed so the order of all the other keys don't matter just the last one
and if you wanted something like LCtrl + A + B to trigger regardless of if you pressed A or B last you would just need to bind it twice this only adds N key bindings to any combination of N keys because you only need one binding for each final key not every permutation of said keys

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions