Jump to content




How to make 2 keys activate something when pressed at the same time?


  • You cannot reply to this topic
2 replies to this topic

#1 CitricThunder

  • Members
  • 33 posts

Posted 08 October 2012 - 11:04 PM

Im trying to make a control panel which will open when you press CTRL ad ALT. I have tried if "key == 29 and 56 then" thinking it would work. Any ideas?

#2 faubiguy

  • Members
  • 213 posts

Posted 08 October 2012 - 11:17 PM

I don't think this is possible to do, because you can't tell when someone stops holding a key down.

#3 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 09 October 2012 - 01:10 AM

The best way to do this would be to start a very short timer (say, a tenth of a second or so) when either key is pressed. If the other key is pressed before the timer expires, you could consider them to have been pressed at the same time.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users