Skip to content

added get_last_key_pressed()#954

Closed
lukasx999 wants to merge 1 commit intonot-fl3:masterfrom
lukasx999:dev
Closed

added get_last_key_pressed()#954
lukasx999 wants to merge 1 commit intonot-fl3:masterfrom
lukasx999:dev

Conversation

@lukasx999
Copy link
Contributor

I think it would be useful to also get the last key that's being held down.

About the TODO's:

I suppose it's not possible to get the first item of a HashSet, as the hash function is randomly generated by default. (https://doc.rust-lang.org/std/collections/struct.HashSet.html)

Warning: hasher is normally randomly generated, and is designed to allow HashSets to be resistant to attacks that cause many collisions and very poor performance. Setting it manually using this function can expose a DoS attack vector.

To fix this, we could either use a consistent hash function, (which would possibly introduce vulnerabilities) or use a simple Vec (which will be slower).

@lukasx999 lukasx999 closed this Apr 23, 2025
@lukasx999 lukasx999 deleted the dev branch April 23, 2025 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant