CraftTweaker

CraftTweaker

151M Downloads

Allow checking for pressed keys through IClient

PrincessRTFM opened this issue ยท 0 comments

commented

Feature request name
Keyboard queries through IClient or a new interface

Feature request description
The ability to use either the client object or a new global keyword object to check the pressed/unpressed status of arbitrary LWJGL keys, eg bool client.keyboard.isKeyDown(string keyName) and/or bool client.keyboard.isKeyDown(int keyCode) with corresponding isKeyUp methods optionally implemented as they can be easily replaced by boolean negation.

Feature request reason
The ability to add tooltips that only show when shift is held, with optional text that only shows when shift isn't held, is a very useful addition and mirrors a common feature in many mods. However, it only works for the shift key. If users could check whether any given key is held down, then it would be possible to mimic this functionality with other modifiers like control and alt, or even to differentiate between left and right modifiers.

Feature request dependencies
An interface to LWJGL would be needed, in order to query the status of specific keys. Additionally, it would be more useful if you could use internal key names (LSHIFT, RCTRL, etc) instead of needing to use numeric key codes. Failing that, scripters could simply define a global int[string] object to map names to codes themselves, so that part is lower priority.