Astrabit-ST / ModShot-Core

A fork of mkxp, forked for OneShot, forked for OneShot mods, (not to be confused with the ModShot server)
https://nowaffles.com
GNU General Public License v2.0
19 stars 9 forks source link

Add input.set_key, input.unset_key, input.get_all_pressed #40

Closed rkevin-arch closed 2 years ago

rkevin-arch commented 2 years ago

As title, part of #39 input.set_key sets a key's pressed and triggered values, and input.unset_key unsets a key's pressed, triggered and repeated values. Both of these functions only last until the current frame finishes (basically until the next input.update) input.get_all_pressed returns a list of integers (all the key codes that are currently pressed). Note that I haven't tested these features, so you should test them and merge if it actually works for your use case

Speak2Erase commented 2 years ago

I'm only pressing the RIGHT key and ACTION. I don't think this should be happening. This is probably

Debug potential memory corruption in input module (I.e. "KEY_RETURN" is triggered by enter, up, down, and backslash, and the pause button (OSFM specifc) toggles every frame)

in #39.

image

Speak2Erase commented 2 years ago

Also, somehow 182 is pressed twice? (This is just pressing ACTION) image

Speak2Erase commented 2 years ago

Input.set_key does not apply to Input.dir4 or Input.dir8.

Speak2Erase commented 2 years ago

This appears not to work with Input text input? I presume that's just because that reads inputs differently though. I can probably just disable uses of it when writing and playing demos since it's only used in the name input screen in FM

Speak2Erase commented 2 years ago

Suggestion: Timer on messageboxes? (I.e. an optional parameter to specify how long they should stay open for)