Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Extension: Key Press #994

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

TheGemDev
Copy link
Contributor

An extension that checks how many times a keyboard key was pressed in a period of time ( maximum delay ), works just like the double click extension but for keyboard keys.

image

@TheGemDev TheGemDev requested a review from a team as a code owner August 28, 2023 20:01
@tristanbob
Copy link
Contributor

Does this also have a function to detect how long a key has been depressed? (for charging spells/attacks)

Condition: "Button X has been pressed for Y seconds"

I also wonder if it should have an expression that shows the percent complete?

Action: Start an X second long charge named "SuperAttack"

Expression: ChargePercent("SuperAttack")

Condition: "SuperAttack" is charging
Condition: "SuperAttack" is fully charged

Action: Cancel charging "SuperAttack" (the user can use this for key released, or perhaps if the player gets hit while charging)

@4ian
Copy link
Collaborator

4ian commented Aug 28, 2023

Just commenting to say that this is a great idea and should simplify the work of many people if this can be flexible enough 👍

@TheGemDev
Copy link
Contributor Author

Does this also have a function to detect how long a key has been depressed? (for charging spells/attacks)

Condition: "Button X has been pressed for Y seconds"

I also wonder if it should have an expression that shows the percent complete?

Action: Start an X second long charge named "SuperAttack"

Expression: ChargePercent("SuperAttack")

Condition: "SuperAttack" is charging Condition: "SuperAttack" is fully charged

Action: Cancel charging "SuperAttack" (the user can use this for key released, or perhaps if the player gets hit while charging)

Sure, i can try adding a feature like that.

@TheGemDev
Copy link
Contributor Author

this works

image

added a condition to check how long a key is pressed for.

added an expression to get the completion percentage (timer/duration*100)

added an expression to return how long a button is pressed
@TheGemDev
Copy link
Contributor Author

I was wondering what data type is required here?. the parameter type is a "keyboard key", but typing the key as a string doesn't seem to work.

image

@D8H
Copy link
Contributor

D8H commented Aug 29, 2023

I was wondering what data type is required here?. the parameter type is a "keyboard key", but typing the key as a string doesn't seem to work.

The screenshot doesn't show the action sentence. I don't have enough context to answer.

@TheGemDev
Copy link
Contributor Author

Okay, I need to take a look at the extension again, I will send an update later in the day.

@tristanbob
Copy link
Contributor

Okay, I need to take a look at the extension again, I will send an update later in the day.

Do you want to work on this more? It is probably close to being merged when you are ready.

@gemmomoh
Copy link

yes, i will still work on it.

@gemmomoh
Copy link

@D8H This was my question, in order to get the key pressed duration I need to get the key user is checking for I used this
image
image

the parameter type is a keyboard key
image

but it still returns an error.

@D8H
Copy link
Contributor

D8H commented Oct 13, 2023

@D8H This was my question, in order to get the key pressed duration I need to get the key user is checking for I used this

the parameter type is a keyboard key

but it still returns an error.

It's really hard to follow with the events being cut.
This parameter type don't accept an expression. If you need call private actions use a text parameter.

@gemmomoh
Copy link

okay

@TheGemDev
Copy link
Contributor Author

image

@D8H
Copy link
Contributor

D8H commented Oct 13, 2023

oh, ok, I guess the key parameter type can't be used for expression parameter. The UI should probably not show it in the list in this case.

@D8H D8H added the ✨ New extension A new extension label Feb 10, 2024
@arthuro555 arthuro555 added ⏱ Waiting for reviewer attention A reviewer needs to come take (another) look at this submission 👨‍👩‍👧‍👦 Community extension An extension submission to be merged ASAP with a lightweight review. labels Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👨‍👩‍👧‍👦 Community extension An extension submission to be merged ASAP with a lightweight review. ✨ New extension A new extension ⏱ Waiting for reviewer attention A reviewer needs to come take (another) look at this submission
Projects
Status: Needs review
Development

Successfully merging this pull request may close these issues.

6 participants