reaper2259 Posted July 22, 2016 Share Posted July 22, 2016 Hey everyone im wondering if there is any way to get when a key is released in lua. I know how to get when the key has been pressed down with KeyHit but i need something like KeyRelease or KeyUp because i need to call something when the player releases the specific key. also is there any way to get when any key is pressed such as window:KeyHit(Key.Any) these would be really useful in many ways. thanks for any help. Quote Link to comment Share on other sites More sharing options...
shadmar Posted July 22, 2016 Share Posted July 22, 2016 Maybe test for when KeyDown() is no longer true? Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
reaper2259 Posted July 22, 2016 Author Share Posted July 22, 2016 Maybe test for when KeyDown() is no longer true? Heyy sorry for the confusion but i know how to manually do it using Booleans and if statements but was just wondering if there is any actual call like KeyUp which would just make things easier and less code when you need to make a lot of calls. I don't have a project requiring heavy amounts of key release actions right now but its just something that would be of use. Thanks for your help but i guess there isn't any such code currently. Quote Link to comment Share on other sites More sharing options...
martyj Posted July 22, 2016 Share Posted July 22, 2016 Why not check for key hit instead of KeyDown? Are you making a chat box? Quote Link to comment Share on other sites More sharing options...
reaper2259 Posted July 22, 2016 Author Share Posted July 22, 2016 Why not check for key hit instead of KeyDown? Are you making a chat box? hi im not making a chat box and keyhit only returns when the key is first pressed, im not making anything really i was just looking to see if there was a way to just call something like KeyUp or KeyRelease rather than typing out my own manual checks. Quote Link to comment Share on other sites More sharing options...
Josh Posted July 22, 2016 Share Posted July 22, 2016 The new GUI and events system supports a KeyUp event. 2 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.