Also, is there any way to tell how long it is pressed for, and when it is let go?
To find how long it is pressed for you would set a variable to tick() in your KeyDown function like so:
mouse= --(However you're getting the mouse) mouse.KeyDown:connect(function(key) --Do whatever you want with that key here pasttime=tick() end)
Then in your KeyUp function would set another variable to tick() and subtract the pasttime variable from the variable you just set. Example:
mouse.KeyDown:connect(function(key) --Do whatever you want with that key here currenttime=tick() keytime=currenttime-pasttime end)
The keytime variable would be the time the key is pressed.