_pKeys.lua module [LUA Modders Resource]

Rate:
Downloads: 5
Views: 418
Comments: 0
Category: Tools
Upload by: XKillER

Description

Short version:

adds 4 functions for better key control



GetKeyJustPressed(key)

GetKeyJustReleased(key)

GetKeyPressed(key)

GetKeyReleased(key)



the module requires current version of LUA Plugin for Script Hook V which includes the "keys.lua" that it also requires in order to work, and it needs to be put into "scripts\addins" or "scripts\libs" folder



Long version:

Well, im taking the chance here, maybe im wrong again and the functions are already somewhere, but i havent seen them anywhere.



We all know the "get_key_pressed(key)" function, its a solid function, but alone its useless, combined with "while get_key_pressed(key) do wait(0) end" it can act as a function that triggers on key release, however with "wait(0)" it freezes all LUA scripts, and without it, it freezes the whole damn game. There is no other way to intercept the exact moment of key being pressed or released than making our own functions, and if every single LUA scripter does that with their own functions, then it will use more resources than it really needs.



Rambling section:

And that got us where we are now, if these functions really dont exist then its all good, if they do then 2 weeks from now, some dude shows up and he will point out a website nobody ever heard of that contains all the functions and ill feel once again like a moron who jumped under a train trying to do something good and instead got his legs removed, not literally, but you know, psychical pain is real too!





You can modify and reupload this mod without my permission, however that will possibly defeat the purpose of it being here, which is to not waste resources.
Show Full Description

Rating

0
5
4
3
2
1
Your rate

Write comment:

Please enter review or comment.
Please choose a name.
Email invalid.