Jump to content
Rick

What key was hit

Recommended Posts

I don't recall and Window doc doesn't seem to show this, but was there a way to get what key was hit vs having to loop over them all to check KeyDown()? This is handy for allowing uses to type in a textbox.

Share this post


Link to post

You have to loop through each of the keys, yea. You would only have to do that when the player wants to type something though. You can disable the loop whilst the player is busy gaming and not chatting. It doesn't really lag the game much, looping through 255 indexes is rather fast in my game.

Share this post


Link to post

Is that how the new GUI system does it? I swear Josh added some function that returned the key for his textbox GUI but I don't have access to any LE code right now.

Share this post


Link to post

So his GUI has KeyDown and KeyUp events and one blog talks about KeyChar events. Does anyone know if these events are called when attached to any script? Even entity scripts? This would certainly help.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...