#UserInputService question

1 messages · Page 1 of 1 (latest)

jolly grove
#

In this script I want to detect whenever the LeftShift key is being held down, but the array received from GetKeysPressed() never includes LeftShift.

#

nvm fixed it

echo cradle
#

You can just use userinputservice.inputbegan/ended btw

brave ingot
#

Otherwise combine UserInputService.InputBegan with UserInputService.InputEnded

graceful robin
#

why would he poll this shit

#

when he can use event driven approach

graceful robin
#

or actions

brave ingot
# graceful robin thats literally worse

That is an overreaction. There are no performance ramifications. Regardless, I did immediately suggest that OP use a combination of InputBegan and InputEnded. UserInputService:IsKeyDown is simply consistent with his original design

#

No harm in knowing your alternatives

robust yarrow
#

so I would have to agree with the bay harbor ragebaiter

#

the os gives you interrupts for input events, its not a polling loop under the hood

#

lmao

#

please stop embarassing urself

#

when you press a key the keyboard sends a hardware interrupt to the OS which queues the event, roblox picks it up and fires InputBegan. theres no loop