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

Returning true from keyboard event does not block input #2264

Open
ABCRic opened this issue Jan 5, 2023 · 0 comments
Open

Returning true from keyboard event does not block input #2264

ABCRic opened this issue Jan 5, 2023 · 0 comments

Comments

@ABCRic
Copy link

ABCRic commented Jan 5, 2023

The wiki says this about the keyboard event:

Triggers on any keyboard action, including release of a button. Optionally returns a bool indicating whether or not the keyboard action has been caught. If true, it will not be passed on to the next stage, so the keyboard action would never reach the game.

With the following code loaded as an addon:

require('luau')
windower.register_event('keyboard', function(dik, down)
    if dik == 44 then
        log('z')
        return true
    end
end)

pressing Z will cause the message "z" to be printed, but the key is not blocked from reaching the game. It will still toggle run/walk mode for the player character. Also tested with W (17) and F (33) for walking and activating the log window respectively.

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

No branches or pull requests

1 participant